Open shinobi01 opened 4 days ago
@shinobi01, thank you for creating this issue. We will troubleshoot it as soon as we can.
Triage this issue by using labels.
If information is missing, add a helpful comment and then I-issue-template
label.
If the issue is a question, add the I-question
label.
If the issue is valid but there is no time to troubleshoot it, consider adding the help wanted
label.
If the issue requires changes or fixes from an external project (e.g., ChromeDriver, GeckoDriver, MSEdgeDriver, W3C),
add the applicable G-*
label, and it will provide the correct link and auto-close the
issue.
After troubleshooting the issue, please add the R-awaiting answer
label.
Thank you!
@shinobi01 could you share a histogram of your memory dump? The easiest way is to call jmap -histo {pid}
It would be helpful to know the exact version when it did break. Thanks in advance
@joerg1985 This is the log running on Linux jenkins slave. hs_err_pid51968.log The first time I have this error is on September, but the reproduce rate is not frequently. But on 4.26.0, it is 100% reproduce.
@shinobi01 this crash dump does not contain the infos i need, the output should look like this
@shinobi01 are you using the WebDriverDecorator
?
I think i could reproduce the root issue, each invocation does return a new class.
Are you intentionally keeping hunderts references to WebElements found?
Each WebElement brings it's own class definition, due to the Proxy and this could kill your class space.
This is a extension to the DecoratedWebDriverTest to reproduce the issue.
@Test
void doesNotCreateTooManyClasses() {
final WebElement found = mock(WebElement.class);
Function<WebDriver, WebElement> f = $ -> $.findElement(By.id("test"));
Fixture fixture = new Fixture();
when(f.apply(fixture.original)).thenReturn(found);
WebElement proxy1 = f.apply(fixture.decorated);
WebElement proxy2 = f.apply(fixture.decorated);
WebElement proxy3 = f.apply(fixture.decorated);
assertThat(proxy1.getClass()).isSameAs(proxy2.getClass());
assertThat(proxy1.getClass()).isSameAs(proxy3.getClass());
}
@joerg1985 sorry, i have no idea about WebDriverDecorator, i started the webdriver by using selenide appium.
This might be related to https://github.com/appium/java-client/issues/2119 but in any case the WebDriverDercorator does create to mutch classes without the PR above.
What happened?
I'm using Java + Cucumber + testNG + Appium to do automation test on mobile devices. I got some errors as following Caused by: java.lang.OutOfMemoryError: Compressed class space So I checked with VisualVM, the Metaspace and Classes are always increasing.
The loaded classs are not unloaded. After downgrade to 4.23.0, this issue is gone
How can we reproduce the issue?
Relevant log output
Operating System
macos 14.4.1
Selenium version
Java 17 + Java-Client 9.3.0 (Selenium 4.26.0)
What are the browser(s) and version(s) where you see this issue?
Android and iOS
What are the browser driver(s) and version(s) where you see this issue?
None
Are you using Selenium Grid?
None