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

Bug 244387

Summary: Memory leak when adding/removing filters
Product: [Tools] GEF Reporter: Lars Grammel <lars.grammel>
Component: GEF-Legacy ZestAssignee: Ian Bull <irbull>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: ahunter.eclipse, nyssen
Version: 3.4   
Target Milestone: 3.5.0 (Galileo) M3   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
memory leak patch
none
test case none

Description Lars Grammel CLA 2008-08-17 21:04:14 EDT
After adding and removing filters to the Zest graph viewer, I ran into an reproducible OutOfMemoryError (~20 times adding/removing filters, graph size about 1400 nodes). 

I added a patch that seems to fix the problem by cleaning the figures2items map and remove nodes from the node map when they are removed. I am not sure if the removing of the nodes makes a difference, but the cleaning of the figures2items map eliminated the memory leak and led to better performance when working with filters.
Comment 1 Lars Grammel CLA 2008-08-17 21:05:25 EDT
Created attachment 110185 [details]
memory leak patch
Comment 2 Ian Bull CLA 2008-10-10 18:54:18 EDT
Created attachment 114855 [details]
test case

Here is a test case that demonstrates this bug.
Comment 3 Ian Bull CLA 2008-10-10 19:35:31 EDT
I have actually fixed the figure2items map problem in 235814, but there seems to be anther leak somewhere.  I will keep looking.
Comment 4 Ian Bull CLA 2008-10-14 13:00:00 EDT
I have tracked this down.  When filters are added and removed, the graph gets recreated.  If you do this a bunch of times, you can end up adding too many nodes to the dirty region.  I now force an update after every viewer refresh and this clears the dirty regions and fixes the problem.
Comment 5 Anthony Hunter CLA 2008-10-15 13:20:22 EDT
Don't forget to set the milestone when you resolve the bug.
Comment 6 Alexander Nyßen CLA 2014-05-22 03:44:36 EDT
Comment on attachment 110185 [details]
memory leak patch

It seems this patch has not been applied, thus marking it as obsolete.