Skip to main content

How to optimize Java 3D memory usage

No replies
neil1988
Offline
Joined: 2010-09-13
Points: 0

Hi all,

My 3D model switches between 6 different textures. Each texture set is about 700K. When I run my applet, it can eat 400M memory very easily. -- --!

I find that the more textures I have, the more memory the applet will use. If use 2 texture sets, it will eat 180M.

At first, the momory usage is 200M, but when I begin to switch textures, the memory usage increases as fast as a rocket....

I wonder is there any ways to help optimize Java 3D memory usage?

This is how I set the original texture:

textureUnitStateTop[0] = new TextureUnitState(oakWoodTextureTop, texAttr1, null);

textureUnitStateTop[0].setCapability(TextureUnitState.ALLOW_STATE_WRITE);

appearanceTop.setTextureUnitState(textureUnitStateTop);

This is how I change texture:

textureUnitStateTop[0].setTexture(this.cherryWoodTextureTop);