-
-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
Selenium 4 beta 3 high memory usage #9536
Comments
This depends on the number of processors available when the jars are started. We use internally We have also done some stress test in the new Grid, running up to 60 tests in parallel for about one hour. The Hub had 16GB of RAM and 4CPUs, and the memory did not go up over 2.5GB since there were 4 CPUs. A more complete and detailed analysis can be seen in #9152, so please have a look and we'll leave this issue open for a while in case you have questions. |
Thanks @diemol, that makes sense for how the node uses a large amount of RAM (although in my mind, it's still a bit excessive - possibly an issue with AsyncHttpClient), but in the case I mentioned above the hub takes even more RAM than the node. While I'm not familiar with the architecture of the hub (I'm also not a java developer), it doesn't seem to make sense to tie the thread pool to the number of processors (as I would not expect the hub to be CPU bound). When I look at the stress tests that have been done, they don't appear to have been running for a long period of time. One of our use cases involves running behat with over 160k steps single threaded on a PHP application talking to a MSSQL database (we do the same runs on MySQL and Postgres as well) which takes over 48 hours (yes there are other improvements we could be doing). When I've got a bit more time, I'll have a look to see if the Java memory flags (eg. I'm testing on an i7 (4 physical cores running as 8 virtual) with 32Gb of RAM, but it is my development machine so RAM is well utilised. |
I did another full run of our suite over the weekend (again a single thread for 160,000 behat steps). This time starting the hub and node with the following commands:
As a comparison, I also had a selenium 3 hub and node setup (max of 5 threads, and was maxing out most of the time the v4 beta was running) which is currently using a combined 2.5GB RAM. There were also a few more failures (which are probably our fault) this time as well. This tells me that I haven't triggered #9152 (As I would expect RAM usage to have dropped by the |
I'm also experiencing abnormal memory usage on the dockerized version of selenium node (docker image: selenium/node-firefox:4.0.0-rc-1-prerelease-20210618). Here is a thread dump taken after 9 days uptime, this is one of 7 pods we are running, they only run a couple tests every 5 minute: There are 6197 threads in the "Driver Service Executor" thread group, and I suspect this is only going to increase. We've rolled-back to docker tag version 4.0.0-beta-3-20210426 for the time being |
Thank you for providing the details. The growing thread count for "Driver Service Executor" was a leak. It has been fixed as part of #9677. |
Thanks for adding these details, @pujagani. We can close this for now as it will be part of the next release. |
HI @diemol, I wouldn't be surprised if there are multiple bugs leading to this situation. Kind regards, |
Thank you for following up. The changes are made after Beta-4 hence will the fix will be available as part of the next release. |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
🐛 Bug Report
When compared to running Selenium v.3.141.59 in hub and node setup, Selenium 4 beta consumes considerably more memory.
Usually when running Selenium 3.141.59 I would have 1 hub and 2 nodes - one with usually 5 threads running through xvfb and another 1 with 1 thread for confirming scenario's. The hub would rarely exceed 500mb memory usage, and the node running 5 threads rarely exceeded 1.5 gb after running for a few days.
After running overnight (~16 hours), Selenium 4 beta hub is consuming 4gb and the node is using 3.4gb (capability of 8 threads, but only 1 running) (note I also had a Firefox tab pointing to the server page (<server_url>:/ui/index.html#/)
To Reproduce
Detailed steps to reproduce the behavior:
Run a large suite overnight.
Moodle (moodle.org) is a large open source project that has a large suite that could be used (although this is not what I tested with, and may need some modifications to get to work with Selenium 4)
Expected behavior
RAM Usage for hub and node should be under 2 gb
Test script or set of commands reproducing this issue
Run a large suite
Environment
OS: Ubuntu 20.04 LTS
Browser: chrome
Browser version: 91.0.4472.77 (Official Build) (64-bit)
Browser Driver version: ChromeDriver 90
Language Bindings version: PHP
Selenium Grid version (if applicable): 4 beta 3
Java Version:
openjdk 11.0.11 2021-04-20
OpenJDK Runtime Environment (build 11.0.11+9-Ubuntu-0ubuntu2.20.04)
OpenJDK 64-Bit Server VM (build 11.0.11+9-Ubuntu-0ubuntu2.20.04, mixed mode, sharing)
The text was updated successfully, but these errors were encountered: