World Wind Forums

Go Back   World Wind Forums > WorldWind JAVA forums > Development Help

Development Help Help for building applications or diagnosing problems with WWJ

Reply
 
Thread Tools Display Modes
Old 11-24-2011, 09:33 PM   #1
isoman
Junior Member
 
Join Date: Feb 2009
Posts: 17
isoman is on a distinguished road
Default how to reset a layer properly ?

Hello,
I'm using wwj to load dynamiclly WWicon from a databse every seconds , insert them in a renderbale layer and display them .
It's working but if I let my application work for a long time (2 hours) I get an out of memory exception .
I'm clearing the content of the layer with this piece of code but I thinks that it's not enough to free the memory :
Code:
  layerVol.removeAllIcons();
        layerVol.resetListeVol();
        layerVol.dispose();
Thanks for the help .
isoman is offline   Reply With Quote
Old 12-06-2011, 07:36 PM   #2
trojan_chick
Junior Member
 
Join Date: Jul 2011
Posts: 5
trojan_chick is on a distinguished road
Default

Sounds like a memory leak of some sort.

Not sure if you're just reusing layerVol as a container, or making a new layerVol every time you regenerate the layer, but check to see if layerVol.dispose() sets layerVol to null. If not you might want to try this before calling
System.gc().
trojan_chick is offline   Reply With Quote
Old 12-07-2011, 06:03 PM   #3
heidtmare
Senior Member
 
heidtmare's Avatar
 
Join Date: Feb 2008
Location: Melbourne, FL, USA
Posts: 678
heidtmare is on a distinguished road
Default

removeAllIcons(); // clears the collection
resetListeVol(); // doesn't exist as far as i can tell
dispose(); // does nothing in an IconLayer

your issue is probably with the renderables and tc's proably spot on with a garbage collection issue. make sure your not holding a reference to the images anywhere but in the renderable.
__________________