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
spring-cloud-gcp memory issue #653
Comments
That's strange. I'd expect builders to be short-lived objects. Maybe we have a memory leak somewhere? |
Yes something is memory-leaking because an enforcer rule single invocation at the kotlin-sample-app directory passes. I think the Builder is behaving as expected though. It’s scanning many class files in many jar files until JVM encounters OutOfMemoryError. |
Linkage Checker performs two steps:
Failed case (OutOfMemoryException at the end of mvn verify in the root directory, at the end of Step 1 of spring-cloud-gcp-kotlin-app-sample module):
Successful case (mvn verify in
|
Using a unit test to analyze spring-cloud-gcp jar files:
The following table compares three implementations with 1G/2G heap size:
NoCachingClassPathRepository is a custom ClassPathRepository that does not cache class at all. |
Performance evaluation of new
Maximum cache size 500-1000 gives the best performance (16 seconds). It's an increase from 10.8 seconds by |
Thanks to ConstantUtf8 cache (my local modification with
MAX_CACHE_ENTRIES=2000000
andbcel.maxcached.size=200
), "Spring Cloud GCP Autoconfigure Module" in spring-cloud-gcp does not fail with "OutOfMemoryError: GC overhead limit exceeded".However, even with the ConstantUtf8 cache , the enforcer rule applied on spring-cloud-gcp project fails at spring-cloud-gcp-kotlin-app-sample (the last module in spring-cloud-gcp):
JProfiler shows 606 MB is used for
LinkedHashMap$Entry
instances. The biggest entries are held bySymbolReferenceMaps
'ImmutableSetMultimap.Builder
.Memo
Maven option to let a debugger attach the process:
Maven option to heapdump upon OutOfMemoryError:
The text was updated successfully, but these errors were encountered: