Большое количество тестов. При прохождени занимают около 10 минут, выдают OutOfMemoryException
столкнулся с такой ошибкой, у меня есть бэк на спринг бут, который покрыт порядка 500-700 тестов, некоторые из них поднимают контекст, он поднимается довольно долго и ресурсо затратно. При запуске тестов через ./gradlew clean build где-то на середине прохода тестов начинают появляться вот таке логи :
[303.647s][warning][gc,alloc] ClassGraph-worker-2318: Retried waiting for GCLocker too often allocating 256 words
[303.647s][warning][gc,alloc] ClassGraph-worker-2321: Retried waiting for GCLocker too often allocating 256 words
[344.100s][warning][gc,alloc] ClassGraph-worker-2311: Retried waiting for GCLocker too often allocating 65536 words
[344.100s][warning][gc,alloc] ClassGraph-worker-2319: Retried waiting for GCLocker too often allocating 256 words
[346.936s][warning][gc,alloc] ClassGraph-worker-2311: Retried waiting for GCLocker too often allocating 21586 words
[346.936s][warning][gc,alloc] ClassGraph-worker-2312: Retried waiting for GCLocker too often allocating 256 words
[346.936s][warning][gc,alloc] ClassGraph-worker-2304: Retried waiting for GCLocker too often allocating 2750 words
[347.159s][warning][gc,alloc] ClassGraph-worker-2327: Retried waiting for GCLocker too often allocating 9370 words
[347.163s][warning][gc,alloc] ClassGraph-worker-2315: Retried waiting for GCLocker too often allocating 256 words
[347.163s][warning][gc,alloc] ClassGraph-worker-2323: Retried waiting for GCLocker too often allocating 256 words
[347.170s][warning][gc,alloc] ClassGraph-worker-2322: Retried waiting for GCLocker too often allocating 256 words
[347.410s][warning][gc,alloc] ClassGraph-worker-2310: Retried waiting for GCLocker too often allocating 256 words
Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread "FeignApacheHttpClientConfiguration.connectionManagerTimer"
Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread "FeignApacheHttpClientConfiguration.connectionManagerTimer"
Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread "FeignApacheHttpClientConfiguration.connectionManagerTimer"
Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread "qtp1060492372-285"
Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread "ClassGraph-worker-2318"
Секция с тестами в build.gradle вот такая :
test {
useJUnitPlatform()
maxParallelForks = 1
forkEvery = 10
jvmArgs = [
'-Xmx2g',
'-XX:MaxMetaspaceSize=512m',
'-XX:+UseG1GC',
'-XX:G1HeapRegionSize=8m',
'-XX:InitiatingHeapOccupancyPercent=20',
'-XX:ConcGCThreads=1',
'-XX:ParallelGCThreads=1',
'-XX:MaxGCPauseMillis=300',
'-XX:+HeapDumpOnOutOfMemoryError',
'-XX:HeapDumpPath=build/heapdumps',
'-Xlog:gc*:build/gc.log'
]
systemProperties = [
"feign.client.config.default.connectTimeout" : "5000",
"feign.client.config.default.readTimeout" : "5000",
"feign.httpclient.maxConnections" : "3",
"hikari.maximumPoolSize" : "2"
]
}
Может кто сталкивался с такой проблемой, или знает как настройить правильно test в build.gradle