OutOfMemoryError: Java heap space

Started by yxbnnl, March 03, 2009, 10:42:31 AM

Previous topic - Next topic

yxbnnl

Hi:
     
     
      I 've been experiencing OutOfMemory (heap) errors in my application when I try to load a 3ds file (5.15Mb).
     

      code:
             Loading file E:/个人资料/java3D资料/3DS.MAX.MODELS.Cars.www.9iv.com/3M01915/rsq.3DS
             Expanding buffers...1000000 bytes
             Expanding buffers...1500000 bytes
             Expanding buffers...2000000 bytes
             Expanding buffers...2500000 bytes
             Expanding buffers...3000000 bytes
             Expanding buffers...3500000 bytes
             Expanding buffers...4000000 bytes
             Expanding buffers...4500000 bytes
             Expanding buffers...5000000 bytes
             Expanding buffers...5500000 bytes
             File E:/个人资料/java3D资料/3DS.MAX.MODELS.Cars.www.9iv.com/3M01915/rsq.3DS loaded...5406158 bytes
             Processing new material 02 - Default!
             Processing new material 08 - Default!
             Processing new material 13 - Default!
             Processing new material 07 - Default!
             Processing new material 03 - Default!
             Processing new material 04 - Default!
             Processing new material 09 - Default!
             Processing new material 11 - Default!
             Processing new material 05 - Default!
             Processing new material Material #41!
             Processing new material Material #42!
             Processing new material Material #43!
             Processing new material 10 - Default!
             Processing object from 3DS-file: kaput
             Object 'kaput_jPCT0' created using 10624 polygons and 5513 vertices.
             Processing object from 3DS-file: tampon
             Object 'tampon_jPCT1' created using 13296 polygons and 6865 vertices.
             Processing object from 3DS-file: camurluk
             Object 'camurluk_jPCT2' created using 3648 polygons and 1922 vertices.
             Processing object from 3DS-file: kapi
             Object 'kapi_jPCT3' created using 9712 polygons and 5022 vertices.
             Processing object from 3DS-file: kasa
             Exception in thread "main" java.lang.OutOfMemoryError: Java heap space



EgonOlsen

The default size for the heap is 64m. Try to increase it to 256m or something by specifying -Xmx256m as a VM-startup parameter for your application. In addition, try to set Config.saveMemory=true;