Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 321687

Summary: [Model Browser] Memory increases when closing the model browser
Product: [Modeling] MoDisco Reporter: Nicolas Guyomar <nicolas.guyomar>
Component: InfrastructureAssignee: Nicolas Bros <nicolas.bros>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P2 CC: fabien.giquel, gdupe, hugo.bruneliere, modisco.web-inbox, nicolas.bros
Version: 0.8.0Flags: nicolas.bros: helios+
Target Milestone: 0.8.2   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Nicolas Guyomar CLA 2010-08-04 05:37:11 EDT
Hi,

Used memory (displayed with the heap status bar in Eclipse) increases when closing the model browser.

I would expect the resources involved to be released and the garbage to clean the memory.
Is this the correct behavior for MoDisco Model Browser ?

Regards

Nicolas
Comment 1 Nicolas Bros CLA 2010-08-09 06:51:00 EDT
When the browser is closed, it unloads the edited resources. This causes a temporary spike in memory usage. But this memory should be freed by the GC eventually, or immediately if you click on the garbage bin icon on the heap status bar in Eclipse.

To easily determine whether the browser is leaking memory, you can open and close models repetitively, and trigger the GC manually each time (clicking on the bin icon) . If memory usage increases each time, then you have found a leak.

I don't see the memory usage increasing when I follow this method.
Comment 2 Fabien Giquel CLA 2010-08-09 08:38:27 EDT
I have doubt about the utility of calling the unload methods, since the ResourceSet instance is not reused after closing the MoDisco browser... 
We see that calling 'unload' has some disadvantages : 
- memory and may be time cost
- some misc bugs (see bug 318391)

In comparison the "sample reflective ecore model editor" does not call "unload" when closing.

Does someone see a reason to maintain such "unload" calls ?
Comment 3 Nicolas Bros CLA 2010-08-23 09:15:58 EDT
You are right Fabien, calling unload seems unnecessary.
I have removed the call to "unload" when the browser is closed (revision 2964).
I checked, and it doesn't seem to be leaking memory when repeatedly opening/closing large models.
Comment 4 Gregoire Dupe CLA 2010-08-24 06:05:59 EDT
Hi,

Should we apply this patch on the branch 0.8 ?

Grégoire
Comment 5 Nicolas Bros CLA 2010-09-13 09:30:20 EDT
Too late for SR1. Maybe for SR2?
Comment 6 Gregoire Dupe CLA 2010-09-17 10:05:48 EDT
Hi,

We have to report the fix of this bug in the branch 0.8, because the fix can avoid memory problems.

Regards,
Grégoire
Comment 7 Nicolas Bros CLA 2010-09-27 10:58:05 EDT
I applied the modification to branch 0_8 (for SR2) in revision 3233.
Comment 8 Hugo Bruneliere CLA 2010-10-05 04:32:58 EDT
Bug fixed.