| Summary: | Memory Leak caused by adding IElementChangedListener, added in ctor of XtendXpandProject, which is never be released when a project is deleted | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | [Modeling] M2T | Reporter: | Johannes Dicks <dicks> | ||||||
| Component: | Xpand | Assignee: | Karsten Thoms <karsten.thoms> | ||||||
| Status: | CLOSED FIXED | QA Contact: | |||||||
| Severity: | normal | ||||||||
| Priority: | P3 | CC: | dicks, karsten.thoms | ||||||
| Version: | unspecified | Flags: | karsten.thoms:
iplog-
karsten.thoms: juno+ |
||||||
| Target Milestone: | SR1 | ||||||||
| Hardware: | PC | ||||||||
| OS: | Windows XP | ||||||||
| Whiteboard: | |||||||||
| Attachments: |
|
||||||||
|
Description
Johannes Dicks
Created attachment 208544 [details]
profiling result
Created attachment 208545 [details]
quickfix
I've patched IXtendXpandProject, XtendXpandProject & XtendXpandModelManager so that the IElementChangeListener is removed by XtendXpandModelManager.
Comment on attachment 208545 [details]
quickfix
a proper solution should just affect implementation of XtendXpandProject without changing interface IXtendXpandProject
Confirmed the profiling result Proposed patch must be modified: For backward compatibility it is not possible to introduce the interface method on IXtendXpandProject. Rather an extended interface IXtendXpandProject2 must be created. Due to different formatting it is hard to see the actual changes :( Next time please avoid formatting of the code. The issue is solved now without need to extend the IXtendXpandProject interface: XtendXpandProject registers an IResourceChangeListener, which deregisters the IElementChangeListener and itself when the project is removed from the workspace. When this happens it is important that the XtendXpandProjects frees all its contained resources, otherwise the project is referenced again by an element in the 'resources' map. Further XtendXpandBuilder did not free the project, since it is indirectly referenced by the 'toAnalyze' set. Now the project can be GCed when it is removed from the workspace. Requested via bug 522520. -M. |