Applet OutOfMemoryError problem

Started by qjvictor, December 01, 2006, 04:51:05 PM

Previous topic - Next topic

qjvictor

Is there any way to solve such a problem?
If my 3ds and md2 files contains many objects (i.e. 1000), or my textures are big, the jPCT will cost much memory to load these resources. And when the program is compiled as Applet to use in client web browsers, the memory requested will greater than the default heap size of the JVM of client ( 64M), so any body has any solution about this issue?
Thanks a lot.

EgonOlsen

You may try to set Config.glAvoidTextureCopies=true and Config.saveMemory=true as the very first commands in your code. Maybe this helps enough to stay within 64m.

qjvictor

Doesn't work.
Does that mean the only way to solve this problem is to reduce the number of the objects in 3ds file or to use Web Start instead of Applet?

EgonOlsen

Webstart is the better solution anyway. Maybe the applet can work with lower detail textures and webstart can be used as a higher quality option. It doesn't seem to be possible to increase the memory from the page that starts the applet, which is a real shame. Here's what i found regarding this topic (directly from sun):

As for your second question, heap/stack/gc memory management for your JRE can be sent by setting the JRE's supported arguments. You can do this via the Java Control Panel or by setting the deployment.javapi.jre.<version>.args property in deployment.properties. W3C's OBJECT and APPLET tags currently do not have any attribute for JRE memory management. We may consider revisiting the tags' attribute to investigate the possibility of supporting the setting of the JRE's arguments. Remember, because only one instance of the JVM exists in a browser session, once the JRE arguments are set, the setting arguments will be in effect for the entire browser process's life.