-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[🐛 Bug]: Memory leaks on Selenium Hub and enabled CDP #2312
Comments
@IlyaUk, thank you for creating this issue. We will troubleshoot it as soon as we can. Info for maintainersTriage this issue by using labels.
If information is missing, add a helpful comment and then
If the issue is a question, add the
If the issue is valid but there is no time to troubleshoot it, consider adding the
If the issue requires changes or fixes from an external project (e.g., ChromeDriver, GeckoDriver, MSEdgeDriver, W3C),
add the applicable
After troubleshooting the issue, please add the Thank you! |
This is the recommended method for downloads: https://www.selenium.dev/documentation/grid/configuration/cli_options/#enabling-managed-downloads-by-the-node. However, this is not a tool to download massive files. It is a use case in automation, but it does not cover all situations. You might try to give more memory to the Hub and adjust it to your use case. Memory will be released when the GC passes, but it is also possible that the size of the file is big enough to exhaust the memory available. |
Hi @diemol, |
We need a way to reproduce the issue. |
Hi, @IlyaUk. Either a complete code snippet and URL/HTML (if more than one file is needed, provide a GitHub repo and instructions to run the code), the specific versions used, or a more detailed description to help us understand the issue. Note: If you cannot share your code and URL/HTML, any complete code snippet and URL/HTML that reproduces the issue is good enough. Reply to this issue when all information is provided, thank you. |
Hi @diemol, |
Hello, For me, disabling the VNC client help : SE_START_VNC: "false" |
The |
SeleniumHQ/selenium@97d56d0 is the promised commit @IlyaUk could you update to the next nightly and check? |
Hi @joerg1985, @diemol
Selenium hub logs output:
|
@IlyaUk @EvgenyMarchuk i have done some fixed related releasing the websocket in SeleniumHQ/selenium@ed3edee, SeleniumHQ/selenium@5bac479 and SeleniumHQ/selenium@7612405. I hope the leak is gone now, could you check this? |
Hi @joerg1985.
|
But those fixes have not been released, are only available in the Nightly version. |
Sure, I tried to reproduce the issue using the nightly builds. Here is my docker compose file:
|
@IlyaUk from todays log the revision is |
May I ask you please to provide the expected revision number so I can double check the issue thorougly? |
The current nightly is SeleniumHQ/selenium@58ca133 Or you could try 4.24.0, this release is brand new and contains the fixes. |
Thanks a lot for the help @joerg1985. The original issue has been fixed and not reproducible anymore. |
@IlyaUk thanks for reporting and testing the fix. |
What happened?
An attempt to run tests that use CDP for files download on remote machine via Selenium Hub (hub and nodes are on the same machine) shows a problem with memory leak on Hub side. As a result test run (around 200 tests and about 10 tests that use CDP) fails with the following exception:
Response code 500. Message: session not created: DevToolsActivePort file doesn't exist
After that Docker stops the Hub container with OutOfMemory exception.
If we dive deep into Selenium server thread dump then we see the following:
About 16132 threads open with stacktrace:
java.lang.Thread.State: RUNNABLE
at sun.nio.ch.EPoll.wait(java.base@17.0.11/Native Method)
at sun.nio.ch.EPollSelectorImpl.doSelect(java.base@17.0.11/Unknown Source)
at sun.nio.ch.SelectorImpl.lockAndDoSelect(java.base@17.0.11/Unknown Source)
at sun.nio.ch.SelectorImpl.select(java.base@17.0.11/Unknown Source)
at zmq.poll.Poller.run(Poller.java:236)
at java.lang.Thread.run(java.base@17.0.11/Unknown Source)
Command used to start Selenium Grid with Docker (or Kubernetes)
Relevant log output
Operating System
Ubuntu
Docker Selenium version (image tag)
4.22.0-20240621
Selenium Grid chart version (chart version)
The text was updated successfully, but these errors were encountered: