Resource Leak

Hi,

A few months back I reported a problem I was seeing with running out of
memory. It has now escalated to become a show-stopping problem. I've
been doing some profiling to see where the resources are going.

I've attached a simple sample program that demonstrates one such case. I
make a Display, add a ScalarMap to it, then repeatedly setRange. When
using a DisplayImplJ3D the instance count of Object[] and many java3d
classes continues to grow. There is no such problem with the
DisplayImplJ2D. I know very little about java3d. I'm hoping there is
something VisAD can do to free up java3d resources and that this is not
a java3d bug that we have no control over.

Any ideas?

Thanks,
Doug

-- 
*----------------------------------------------------------------------*
| Doug Lindholm, Software Engineer          |  E-mail: lind@xxxxxxxx   |
| Research Applications Program             |   Phone: 303-497-8374    |
| National Center for Atmospheric Research  |                          |
| P.O. Box 3000                             |     There's no place     |
| Boulder, Colorado 80307-3000              |        like $HOME        |
*----------------------------------------------------------------------*
import visad.*;
import visad.java2d.*;
import visad.java3d.*;
import javax.swing.*;

public class MemoryTest {

    public void init() {
        try {
            //System.out.println("make display");
            //DisplayImplJ2D display = new DisplayImplJ2D( "test" );
            DisplayImplJ3D display = new DisplayImplJ3D( "test" );
            //DisplayImplJ3D display = new DisplayImplJ3D( "test", new 
TwoDDisplayRendererJ3D() );
            //System.out.println("make map");
            ScalarMap xmap = new ScalarMap( RealType.Time, Display.XAxis );
            //System.out.println("add map");
            display.addMap(xmap);

            int count = 0;
            while ( true ) {
                double now = (double) (System.currentTimeMillis() / 1000.0);
                //  System.out.println("step " + count++ + " now = " + now );
                double then = now - 3600.0;
                xmap.setRange(then, now);
                //Thread.sleep(10);
            }       
        }
        catch (Throwable t) {
            t.printStackTrace();
        }
    }

    public static void main(String[] args) {
        MemoryTest test = new MemoryTest();
        test.init();
    }
}
  • 2002 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the visad archives: