Author Topic: out of memory  (Read 2280 times)

Offline gkapoor

  • byte
  • *
  • Posts: 12
    • View Profile
out of memory
« on: October 16, 2010, 12:22:38 pm »
Hi, i am not able load model second time its giving out of memory issue..first time its working fine....please see this log

----------------------------------------------------------
10-16 15:20:27.552: INFO/dalvikvm-heap(3017): Clamp target GC heap from 25.982MB to 24.000MB
10-16 15:20:27.552: DEBUG/dalvikvm(3017): GC freed 886 objects / 22952 bytes in 39ms
10-16 15:20:27.552: INFO/dalvikvm-heap(3017): Forcing collection of SoftReferences for 3812-byte allocation
10-16 15:20:27.592: INFO/dalvikvm-heap(3017): Clamp target GC heap from 25.982MB to 24.000MB
10-16 15:20:27.592: DEBUG/dalvikvm(3017): GC freed 0 objects / 0 bytes in 39ms
10-16 15:20:27.592: ERROR/dalvikvm-heap(3017): Out of memory on a 3812-byte allocation.
10-16 15:20:27.592: INFO/dalvikvm(3017): "GLThread 9" prio=5 tid=13 RUNNABLE
10-16 15:20:27.592: INFO/dalvikvm(3017):   | group="main" sCount=0 dsCount=0 s=N obj=0x46421490 self=0x161568
10-16 15:20:27.592: INFO/dalvikvm(3017):   | sysTid=3055 nice=0 sched=0/0 cgrp=default handle=1300368
10-16 15:20:27.592: INFO/dalvikvm(3017):   at com.threed.jpct.DeSerializer.readFloatArray(DeSerializer.java:~300)
10-16 15:20:27.592: INFO/dalvikvm(3017):   at com.threed.jpct.DeSerializer.readMesh(DeSerializer.java:279)
10-16 15:20:27.592: INFO/dalvikvm(3017):   at com.threed.jpct.DeSerializer.readAnimation(DeSerializer.java:236)
10-16 15:20:27.592: INFO/dalvikvm(3017):   at com.threed.jpct.DeSerializer.deserialize(DeSerializer.java:180)
10-16 15:20:27.592: INFO/dalvikvm(3017):   at com.threed.jpct.Loader.loadSerializedObject(Loader.java:97)
10-16 15:20:27.592: INFO/dalvikvm(3017):   at android.thearena.Game$Renderer.onSurfaceCreated(Game.java:623)
10-16 15:20:27.592: INFO/dalvikvm(3017):   at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1114)
10-16 15:20:27.592: INFO/dalvikvm(3017):   at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:977)
10-16 15:20:27.592: ERROR/dalvikvm(3017): Out of memory: Heap Size=20423KB, Allocated=19819KB, Bitmap Size=4188KB
10-16 15:20:27.632: WARN/dalvikvm(3017): threadid=13: thread exiting with uncaught exception (group=0x4001b390)
10-16 15:20:27.642: ERROR/AndroidRuntime(3017): Uncaught handler: thread GLThread 9 exiting due to uncaught exception
10-16 15:20:27.642: ERROR/AndroidRuntime(3017): java.lang.OutOfMemoryError
10-16 15:20:27.642: ERROR/AndroidRuntime(3017):     at com.threed.jpct.DeSerializer.readFloatArray(DeSerializer.java:300)
10-16 15:20:27.642: ERROR/AndroidRuntime(3017):     at com.threed.jpct.DeSerializer.readMesh(DeSerializer.java:279)
10-16 15:20:27.642: ERROR/AndroidRuntime(3017):     at com.threed.jpct.DeSerializer.readAnimation(DeSerializer.java:236)
10-16 15:20:27.642: ERROR/AndroidRuntime(3017):     at com.threed.jpct.DeSerializer.deserialize(DeSerializer.java:180)
10-16 15:20:27.642: ERROR/AndroidRuntime(3017):     at com.threed.jpct.Loader.loadSerializedObject(Loader.java:97)
10-16 15:20:27.642: ERROR/AndroidRuntime(3017):     at android.thearena.Game$Renderer.onSurfaceCreated(Game.java:623)
10-16 15:20:27.642: ERROR/AndroidRuntime(3017):     at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1114)
10-16 15:20:27.642: ERROR/AndroidRuntime(3017):     at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:977)
10-16 15:20:27.682: VERBOSE/WifiStateTracker(77): DhcpHandler: DHCP request succeeded
10-16 15:20:27.692: DEBUG/WifiStateTracker(77): DhcpHandler: release ddWakeLock
10-16 15:20:27.692: INFO/wpa_supplicant(123): Rx Data Filter Add [5] command
10-16 15:20:27.692: DEBUG/WifiStateTracker(77): change state to connected for wifi supplicant state=COMPLETED
---------------------------------------------------------------------------------------------

!!!!!!!!!!!!!!please help me to get out of this issue!!!!!!!!!!!!!!



Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11776
    • View Profile
    • http://www.jpct.net
Re: out of memory
« Reply #1 on: October 16, 2010, 06:14:43 pm »
What does "second time" mean? You are loading the model twice in your app or again after recovering from a pause or what? Please be more specific.

Offline gkapoor

  • byte
  • *
  • Posts: 12
    • View Profile
Re: out of memory
« Reply #2 on: October 17, 2010, 12:41:32 pm »
After recovering from a pause...

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11776
    • View Profile
    • http://www.jpct.net
Re: out of memory
« Reply #3 on: October 17, 2010, 09:41:23 pm »
Seems to be similar to this one: http://www.jpct.net/forum2/index.php/topic,1749.0.html

Make sure that every reference to old data is cleared before the new one. In general, i would try avoid reloading all the stuff at all: http://www.jpct.net/forum2/index.php/topic,1657.0.html

BTW: I've uploaded a new jar. Depending on the source of your problem, this may help too.