Closed olezvinskyi closed 11 months ago
Consider calling initElements once on page creation. I don't think it is a good idea to do it multiple times. I also need a heap dump
Consider calling initElements once on page creation. I don't think it is a good idea to do it multiple times. I also need a heap dump
I rerun my tests to generate a new heap dump and I will upload it here. But for now, I can attach a heap dump from old test run https://drive.google.com/file/d/1z30BIFhPi1de648FuCce5ElH90utuENs/view?usp=sharing
I have checked the above heap dump, and it looks fine to me. Nothing too suspicious. Try to get the dump when it actually crashes or close to it (You could use the https://www.baeldung.com/java-heap-dump-capture#automatically)
@mykola-mokhnach https://drive.google.com/file/d/1-Y-AZKdqjAC8G3HPU1-7I1Vc0yIGgspJ/view?usp=sharing fresh heap dump
task runTest(type: Test) {
doFirst {
def weaver = configurations.testRuntimeClasspath.find { it.name.contains("aspectjweaver") }
jvmArgs += "-javaagent:$weaver"
}
systemProperties(System.getProperties())
useTestNG {
setConfigFailurePolicy("continue")
testLogging.showStandardStreams = true
useDefaultListeners = false
Map<String, Object> variables = new HashMap<>()
variables.putAll(getEnvironment())
variables.putAll(getSystemProperties())
def testGroups = variables.get("test.groups")
def prTests = variables.get("pr.tests")
suites 'src/test/resources/' + variables.get("mobile.os") + '/' + variables.get("suite") + '.xml'
if (testGroups && !testGroups.empty) {
def groups = testGroups.split(',')
includeGroups groups
}
if (prTests && !prTests.empty) {
def tests = prTests.replaceAll("\\s","").split(',')
filter {
for(test in tests) {
includeTestsMatching '*.' + test
}
}
}
}
}
- We call initElements once we open a new page and create an instance of this page.
But in 8.5.0 everything worked fine.
I assume it might be some specific to your project setup. Try to profile it and check what data structures are using the most of the memory. Maybe I would be able to help when/if I know for sure which entities they reference and why, and if these entries are part of this library.
I removed PageFactory (initElements) approach and integrated Selenide into my framework. So for now I don't see java.lang.OutOfMemoryError
Description
After I updated java-client 8.5.0 -> 8.6.0 I started facing memory lek (java.lang.OutOfMemoryError: Java heap space). I have a daily suite with a large number of tests (389 tests) and usually, it takes 3-4 hours to complete. In the previous version, everything worked fine but with 8.6.0 after 175-189 tests I got an exception about a memory leak.
Environment
Details
Java: 15 and 17 Gradle: 8.2.1 Selenide: 6.19.0 (which uses the latest appium java-client)
Code To Reproduce Issue [ Good To Have ]
Code
Exception Stacktraces
Exception
Link To Appium Logs
Appium Logs