Closed smithdtyler closed 5 years ago
I have suspicions about the cause of this problem (but didn't want to pollute the top level issue description). Memory Analysis Tool (MAT) suggests a couple of likely problem spots:
156 instances of "org.eclipse.xtext.util.OnChangeEvictingCache$CacheAdapter", loaded by "org.eclipse.xtext.util" occupy 190,713,528 (64.20%) bytes. These instances are referenced from one instance of "java.util.WeakHashMap$Entry[]", loaded by "
MAT reports this on a heap dump generated after approximately 156 calls to
ResourcesPlugin.getWorkspace().build(IncrementalProjectBuilder.FULL_BUILD,
new NullProgressMonitor());
@smithdtyler What happens when you run the same test on OSATE 2.3.7?
It's an issue in AnnexParseUtil. It has been around for years but now is the first time it caused an OOM. AnnexParseUtil has a HashMap that caches parse results. uses a field of the value as the key!
Summary
Java heap usage grows with each OSATE workspace build and cannot be garbage collected, eventually resulting in an OutOfMemoryException.
I created a minimum working example here: https://github.com/smithdtyler/osatememoryleaker
To run the example,
Watch: