Holomatix

Log In / Register


Purchase
Causes of java.lang.OutOfMemoryError in Java console
The memory limits vary according to which Java Virtual Machine (JVM) you are using.

  • Microsoft's JVM has no limit on how much memory can be used.
  • Sun's JVM has a limit of about 96Mb.
  • A Macintosh has a limit of 64Mb.

If you are using Sun's JVM and are getting OutOfMemoryError in the Java console, then you should first find out how much over the limit you have gone. This is most easily done by switching to Microsoft's JVM, opening the Java Console and with the focus in the console you can press 'm' to display how much memory you are using. Figure 1 below shows an example, where around 56Mb memory is being used.

Viewing memory used in the Java console

Viewing used memory in the Java console


The Microsoft VM has no limit on available memory. The number displayed is in bytes, so remove six digits off the end and that's roughly how many megabytes you are using. This number will vary as your presentation runs.

With a 3D presentation, it's usually the case that most memory is taken up by the 3D textures and geometry. You can try running the flash part without loading the 3D model in to find out how the memory divides up. The easiest way to reduce memory usage by the 3D is to make the textures smaller. This can be adjusted in the Compression Settings of Blaze 3D Studio.

Important Note

The memory limit on a Macintosh is 64Mb which is much less than on Windows. For this reason it's often the case that a Flash designer will have a separate 3D .swf file to load up on a Mac. Thus there would be an alternate 3D swf file which uses smaller textures to save memory. You can detect whether the presentation is running on a Mac in ActionScript using the System.capabilities.os string, then choose the 3D file accordingly.

 
< Prev   Next >


© Copyright 2000-2011 Holomatix Ltd. All rights reserved.