> A while ago, this thread was started and I was wondering if there was an
> update to this memory problem?
> My current program has to be able to create a variable number of
> displays depending on the data set the user chooses. Because of this, I
> don't think I will be able to just simply re-use the displays once I
> create them because the number of displays may change unpredictably.
> I have been running the removeAllReferences() and clearMaps() methods
> as suggested as well as running destroy() on the display. I notice that
> memory use climbs rapidly still, around 5-7MB each time I destroy and
> create a new display. Are there any other suggestions to help conserve
> memory as I am running into OutOfMemory Exceptions?
We haven't learned anything new about this. In you situation
I would create a pool of available DisplayImplJ3D's. Instead
of invoking the constructor, call a method of the pool to get
one. It will either give you one or construct one if it has
no free DisplayImpl available. When you done with one, pass it
to a method of the pool that will call its removeAllReferences()
and clearMaps() methods, then add it to a Vector (or whatever)
of free DisplayImpls.
You can reduce the size of FlatFields by using range Sets with
relatively small numbers of samples. Of course, this reduces the
resoltion of range information. If a range Set has < 256 samples,
corresponding values are packed in bytes, and if < 65536 samples
values are packed in shorts.
But most VisAD memory use is in Java3D scene graphs. If you are
using volume rendering, it uses lots of memory.
Bill Hibbard, SSEC, 1225 W. Dayton St., Madison, WI 53706
hibbard@xxxxxxxxxxxxxxxxx 608-263-4427 fax: 608-263-6738