Skip to content

Conversation

@mdmintz
Copy link
Member

@mdmintz mdmintz commented Apr 30, 2025

CDP Mode: Patch 46

To avoid memory leaks in CDP Mode, upgrade to Python 3.12 (or newer).
There's an issue with asyncio in earlier versions, which makes the memory leak unavoidable.

Screenshot 2025-04-30 at 11 47 35 AM

Due to that, there's not much that can be done from the SeleniumBase side to avoid that specific memory leak if you're using an older version of Python. (Only CDP Mode is affected, and only for Python 3.11 and older versions.) That's because CDP Mode using asyncio in the backend, even if you don't call any async functions directly.

@mdmintz mdmintz added enhancement Making things better dependencies This involves updating a dependency file SeleniumBase 4 SeleniumBase 4 UC Mode / CDP Mode Undetected Chromedriver Mode / CDP Mode labels Apr 30, 2025
@mdmintz mdmintz self-assigned this Apr 30, 2025
@mdmintz mdmintz merged commit 5c146c5 into master Apr 30, 2025
6 checks passed
@mdmintz mdmintz deleted the cdp-mode-patch-46 branch April 30, 2025 20:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies This involves updating a dependency file enhancement Making things better SeleniumBase 4 SeleniumBase 4 UC Mode / CDP Mode Undetected Chromedriver Mode / CDP Mode

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Activating CDP Mode more than once for the same driver can lead to asyncio errors asyncio errors on Python 3.11 (and older)

2 participants