-
-
Notifications
You must be signed in to change notification settings - Fork 764
java.lang.OutOfMemoryError: Metaspace happen on appium java client 9.2.3 #2247
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
Comments
@valfirst I'm using Appium v9.2.3 so it should be fixed right? |
@mykola-mokhnach Do you have any idea on that? |
I would try to increase the maximum metaspace size in JVM params: https://www.mastertheboss.com/java/solving-java-lang-outofmemoryerror-metaspace-error/ |
the issue I provided may give you a clue why it happens, in general it would be nice to have a sample project to reproduce the issue |
@mykola-mokhnach already increase the maximum metaspace size in JVM params but no luck still failing with same issue, I just run test in 5mins but the metaspace increase look abnormal ![]() |
Like @valfirst mentioned we would need a sample project then to be able to reproduce the issue locally |
@luckhiem would it be possible to provide a sample without Cucumber? from your sample it's not clear how to inject steps into the configuration ideally it would be nice to have a github project with one line command to run and reproduce the problem |
Hi @luckhiem, I encountered a similar issue in our project. In our case, an excessive number of calls to Byte Buddy were occurring, and the class loader count was too high. To address this, we added a Byte Buddy dependency in the POM.xml to prevent random proxy calls. Additionally, we reviewed all dependencies, removed redundancies, and upgraded to Java 17 and the latest java-client version (9.3). These changes resolved the issue for us. Might be you can also also analyze your classes on runtime and check what exactly is causing issue. We also configured the following Maven Surefire Plugin to optimize test execution:
I hope it will help you . |
Seeing similar strangeness, I have been able to reproduce a simple example here https://github.com/Auto81/SeleniumMemoryLeak I can monitor using VisualVM as the memory usage continues to grow through out the test run. Please let me know if I can provide anything else or need to move this to separate issue, thank you :) |
@mykola-mokhnach @valfirst Sorry to tag yous directly This looks like it's the My attached sample project has it laid out for versions of selenium it does and does not work with. |
Unfortunately I don't have much time to investigate this issue. If someone wants to step in then feel free to do that. |
As far as I see, the cause of memory leak is static field
Apparently, caused by https://github.com/appium/java-client/pull/2129/files @mykola-mokhnach |
java-client 9.3.0, selenium 4.23 - no issue same simple code helps to reproduce issue -> #2119 (comment) |
Have you tried with the jvm args highlight above? #2247 (comment) |
added
-> wow! thanks! just missed that comment. BUT I still believe issues should be fixed on java-client side also. |
@amedvedjev totally agreed but untill someone has time to properly resolve, it's the best we have |
Description
I upgraded the framework from v7 to java-client v9, but after upgrade, we got java.lang.OutOfMemoryError: Metaspace, the test scripts is the same and we not facing this problem in v7 and java8
Environment
Details
Code To Reproduce Issue [ Good To Have ]
pom.xml
The text was updated successfully, but these errors were encountered: