|
Platform: Windows 2000 SP2
CPU: 600 Mhz P3
Memory: 512 MB PC 133
Card: GeForce2 MX 400 32mb
Drivers: NVidia 21.81
Java Version: 1.3.1
Java3D Version: 1.2.1_03 (OpenGL)
I've got a program that has a wakeuponelapsedframes
running. In this program, I have hundreds of Shape3D's that get moved
and scaled, get their transparency set, and their emissive color set each
frame. The translating/scaling is FAST and does not seem to create any
objects when transformGroup.setTransform(transform3D); is called. However,
whenever I perform changes to transparency attributes and or material on a
Shape3D's Appearance, I get all kinds of garbage collecting going on (as
evidenced with -verbosegc). It seems that the two methods below create
many objects in Sun's implementation.
transparencyAttributes.setTransparency(transpVal);
and
material.setEmissiveColor(redVal, 0.0f,
0.0f);
This makes using them for performance critical code
a bad idea. They do work ok, and there are no memory leaks, but the
garbage collector is just getting hit pretty hard (it's running about once
per half-second, for varying amount of times, depending on how many objects are
updated), and it's taking CPU from the rest of my program. When I comment
out these 2 lines, the program only runs GC about once every 15
seconds.
My question is, is there any way around this?
Will the next version of Java3D (1.3) still create
many objects when transparency/material are modified? Can I rely on these
methods to be efficient in the future, or should I not use them for mass updates
every frame and find another way to do what I need to do?
Thanks for any insight...
Michael P. McCutcheon
|
- Re: [JAVA3D] Object allocation within Java3D impleme... Michael P. McCutcheon
