eclipse-platform / eclipse-platform/eclipse.platform

[memory] JavaBuilder.oldState leaks into Workspace.tree

オープン
#910 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
Java
スター
165
フォーク
174
平均マージ
2日 8時間
マージ済み PR(30日)
22

説明

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](https://github.com/eclipse-platform/eclipse.platform/assets/51790620/3f4dc0c2-af0e-497a-823c-9992e715b65b)

![image](https://github.com/eclipse-platform/eclipse.platform/assets/51790620/04b8f220-9dc7-42a1-b72f-b646c68a0f74)
JDKMC:
![image](https://github.com/eclipse-platform/eclipse.platform/assets/51790620/e099ae0c-18a1-44f8-ba9e-08155f5984bc)

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.

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

リンクされたヒープダンプ解析を出発点として使用し、その後 Workspace.tree、DeltaDataTree、InternalBuilder.oldState を読み、JavaBuilder の oldState 参照も確認してください。builder の状態が保持され続ける理由を追跡し、意図されたライフサイクルを特定してください。レビュー済みのアプローチによって意図しない保持が削減され、インクリメンタルビルドが引き続き正しく動作することを示す証拠が含まれれば、issue は完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
java
領域
performance, tooling
issue の種類
バグ
難易度
5/5
見積もり時間
1週間以上
活発さ
停滞
明瞭さ
説明が足りない
初心者へのやさしさ
25/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。