eclipse.platform icon indicating copy to clipboard operation
eclipse.platform copied to clipboard

[memory] JavaBuilder.oldState leaks into Workspace.tree

Open jukzi opened this issue 1 year ago • 2 comments

In the heapdump of https://github.com/eclipse-platform/eclipse.platform.releng.aggregator/pull/1612 most memory was hold by org.eclipse.core.internal.resources.Workspace.tree. VisualVM: image

image JDKMC: image

Workspace.tree is meant to store the state of the Workspace. It does so by storing the history of changes (DeltaDataTree) to the workspace. Interestingly the workspace also stores all IncrementalBuilders which again contain references to the old trees. I.e the Workspace stores a history of things that contain their history. That org.eclipse.core.internal.events.InternalBuilder.oldState sounds like a leak - or say - something that unintentionally stores more memory then intended.

I have however no idea how to reduce that since an IncrementalBuilders needs to know the oldState to calculate increments. Just that the old state is stored again as a history feels odd.

jukzi avatar Dec 01 '23 08:12 jukzi