Re: Resource Leak

after reading this:
and very briefly skimming through this link that it points to:

I did a quick experiment and added these two lines:

               xmap = null;
               xmap = new ScalarMap( RealType.Time, Display.XAxis );

just before the line:

               xmap.setRange(then, now);

and it looks like the memory problem goes away. Chances are that Java3D (especially with VisAD on top of it) is chock full of these "weak" and "phantom" references mentioned in the article. I didn't read enough of the article to understand how to properly use the Reference API, but I imagine building that into VisAD might be the proper solution to this problem. Meanwhile, trying setting anything to null that you can!


Tom Whittaker wrote:


I echo Don's comments "that's some leak". What's interesting is that if the display (in Don's modified code) is covered up by another window, the memory starts increasing again (on Windoz). It also exhibits some interesting behaivor whilst minimized. (I'm using the -verbose:gc option to watch the GC run.)

Also, periodically, I get this exception:

at at visad.java3d.DisplayRendererJ3D.setTransform3D(DisplayRendererJ3D.jav
at visad.java3d.ProjectionControlJ3D.setMatrix(
at visad.java3d.DisplayRendererJ3D.setWaitFlag(
        at visad.DisplayImpl.doAction(
        at visad.util.ThreadPool$

No help (sorry), just observations...


john brecht
sri international
650 859 2325

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