Menu

#633 Memory leak while proving

2.5
closed-fixed
5
2012-10-17
2012-09-18
Shawn Zhang
No

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.

Discussion

  • Shawn Zhang

    Shawn Zhang - 2012-09-18

    workspace log file

     
  • Laurent Voisin

    Laurent Voisin - 2012-09-20

    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.

     
  • Laurent Voisin

    Laurent Voisin - 2012-09-20
    • summary: Memory leak happend while proving --> Memory leak while proving
    • labels: 817322 --> Event-B prover
     
  • Shawn Zhang

    Shawn Zhang - 2012-09-21

    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...

     
  • Laurent Voisin

    Laurent Voisin - 2012-10-04

    Dear Shawn, your proposed fix makes a lot of sense. One should indeed always dispose an SWT component before it gets garbage collected.

     
  • Laurent Voisin

    Laurent Voisin - 2012-10-17

    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.

     
  • Laurent Voisin

    Laurent Voisin - 2012-10-17
    • status: open --> closed-fixed
     

Log in to post a comment.