06-02-2008, 06:53 PM
I have an Eclipse Rich Client Application which has an embedded Prefuse display inside an AWT_SWT view.
The Prefuse Display is linked through some event mechanisms to listen to changes to the model of my application. I have noticed that there is a gradual memory leak every time I am updating my screen. I believe I have narrowed this down to the Prefuse source.
First, I was curious if any of the changes recommended in this developer's blog have been addressed:
To refresh my prefuse display I am calling:
graph.clear(); //Clears the prefuse Graph Model
addTuplesToGraph(); //Refreshes graph tuples
//getVisualization() returns m_vis of prefuse.Display
getVisualization().reset(); //
getVisualization().add("graph", graph);
//_defaultRendererFactory was previously created and is cached for refresh
getVisualization().setRendererFactory(_defaultRendererFactory);
//Then call my actions for coloring and layout
getVisualization().run(ACTIONLIST_COLORS);
getVisualization().run(ACTIONLIST_LAYOUT);
And that's it. Is it possible that going about my refresh above is causing this memory leak?
I suppose it may be possible to update the existing graph model, rather than replacing it on each refresh; however, this is an undesirable pattern at the moment. This is because I may not know every individual change (command stack) that occurred to my application model that needs to be sequentially applied to the prefuse Graph model, so a full refresh solves that immediate issue.
The Prefuse Display is linked through some event mechanisms to listen to changes to the model of my application. I have noticed that there is a gradual memory leak every time I am updating my screen. I believe I have narrowed this down to the Prefuse source.
First, I was curious if any of the changes recommended in this developer's blog have been addressed:
To refresh my prefuse display I am calling:
graph.clear(); //Clears the prefuse Graph Model
addTuplesToGraph(); //Refreshes graph tuples
//getVisualization() returns m_vis of prefuse.Display
getVisualization().reset(); //
getVisualization().add("graph", graph);
//_defaultRendererFactory was previously created and is cached for refresh
getVisualization().setRendererFactory(_defaultRendererFactory);
//Then call my actions for coloring and layout
getVisualization().run(ACTIONLIST_COLORS);
getVisualization().run(ACTIONLIST_LAYOUT);
And that's it. Is it possible that going about my refresh above is causing this memory leak?
I suppose it may be possible to update the existing graph model, rather than replacing it on each refresh; however, this is an undesirable pattern at the moment. This is because I may not know every individual change (command stack) that occurred to my application model that needs to be sequentially applied to the prefuse Graph model, so a full refresh solves that immediate issue.