[visad] memory leak in visad

I have been using visad and idv classes for offscreen rendering. On long lived apps, using IDV's MapProjectionDisplay, I run out of memory. My apps are of the form

new MapProejctionDisplay
add a DisplayableData

Using the jhat heap dump analysis tool in Java6, I think I have found the culprit. visad's DisplayRealType has a static vector into which all instances are added. There is no method to remove instances from this list. So even making sure that names of DisplayRealTypes do not clash, my program leaks.

I am happy to fix this locally in the source code, but am unsure of the implications, even within this one class. Why must names be unique? Can I just add a 'remove by name' method and call this from somewhere, probably MapProjectionDisplay??

I note that in ScalarType, use is made of WeakMapValues, in order to avoid another memory issue relating to static maps. This idiom seems to have not crossed over to DisplayRealType?? It seems like DRT is almost duplicating uniqueness logic already in ScalarType????

Any advice appreciated


  • 2008 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the visad archives: