The Rodin will fail to response after working in proof perspective for a long time,
Attached is the workspace log after Rodin failed to response.
After reading the Rodin source code, i suspect that the following three class may have caused memory leak, will finally caused the bug.
- org.eventb.internal.ui.cachehypothesis.CacheHypothesis
- org.eventb.internal.ui.searchhypothesis.SearchHypothesis
- org.eventb.internal.ui.goal.Goal
These three classes overide doCreatePage but don\'t override doDestroyPage.
workspace log file
Dear Shawn, thank you very much for this very detailed report. It seems you've already done most of the work. We will have a very careful look at this and expect to fix it for the next Rodin release.
Sorry, I found that the common base class of these three classes have already defined doDestroyPage. So the root cause is not what i have originally metioned.
But there still is a bug, and we can easily reproduce it by clicking "search hypothesis" button on the "Proof Control" panel for Dozens of times.
There may be two other questionable points in the HypothesisComposite class:
- reinitialise() method, in which a StyledText object is create every time this method is called without calling its dispose() method first.
- dispose() method, in which control.dispose() is not called.
If i fix the above two places, I can't reproduce the bug by the way mentioned above. But I not sure if I am doing right for I'm new to eclipse and Rodin...
Dear Shawn, your proposed fix makes a lot of sense. One should indeed always dispose an SWT component before it gets garbage collected.
Proposed fix applied and committed to Subversion (r15196).
From my experiments, it also seemed to fix memory leaks.
This fix will be available starting with Rodin 2.7 RC1.
Thank you Shawn for your help.