Unidata - To provide the data services, tools, and cyberinfrastructure leadership that advance Earth system science, enhance educational opportunities, and broaden participation. Unidata
         
  advanced  
 

Re: AW: Memory problems with VisAD

>> One approach is to re-use DisplayImplJ3Ds rather than destroying
>> them and constructing new ones. Calls to its removeAllReferences()
>> and clearMaps() methods should set a DisplayImplJ3D up for re-use
>> (Dave or Curtis please correct me if anything else is needed).
>
>Won't work for me because I often have to change the DisplayRenderer of
>my DisplayImpl (DisplayRendererJ3D, TwoDDisplayRendererJ3D). Hence there
>is no setDisplayRenderer the only way to do this seems to be
>constructing a new display.

The way the VisAD SpreadSheet handles switching DisplayRenderers is
pretty simple: it constructs a separate display for each of the three
different DisplayRenderers available (DisplayRendererJ3D,
DisplayRendererJ2D, and TwoDDisplayRendererJ3D).

Then, whenever the user switches the dimension, it saves the maps and
references, clears them from the current Display, removes the Display
from the GUI, adds the new Display to the GUI, and adds the maps and
references back onto the new Display.

So, if you only have a small set of possible DisplayRenderers, you
could probably do something similar without too much overhead.

-Curtis


 
 
  Contact Us     Site Map     Search     Terms and Conditions     Privacy Policy     Participation Policy
 
National Science Foundation (NSF) UCAR Community Programs   Unidata is a member of the UCAR Community Programs, is managed by the University Corporation for Atmospheric Research, and is sponsored by the National Science Foundation.
P.O. Box 3000     Boulder, CO 80307-3000 USA     Tel: 303-497-8643     Fax: 303-497-8690