Very confusing indeed..
I have used optipng and pngout on the images and fixed up any apparent errors (there were some)... But still I get the problem. Rebooting my phone fixed the very early "outofmemoryerror" but I still get one further into my app. Granted it is doing some heavy work and loading a bit of info but the memory monitor on the WTK and my own systemouts from Runtime.freememory etc show that it appears to stick around 200/300k Free mem from a possible 800k - there is no evidence of it going drastically out of control, and System.gcs have got it even lower (despite small delays). I guess it expands as needed this 800k limit also.
I was able to catch the throwable, do a System.gc and try and carry on - my app didnt carry on working properly but atleast it got rid of the "unhandled" exception on the N73.. Im baffled!! I then did a test in a seperate app which loads up all 30 of my images in a loop 10x over... here on both the emulator and phone it handled well.. it seemed to almost run out mem then gc, then this would keep happening, therefore it never got above 800k max and usage hung around between 200k-400k jumping right down each time etc.. so I know the phone can load all of these 30 images, even 10x over without hitting an out of memory exception!!
Im wondering, is it possible to write a loop so complex that it declares so many internal variables that this somehow kills the phone before it gets a chance to GC? But why doesnt my mem manager show this leap in mem usage if its happening? I can pretty consistently kill the phone by opening this one part of my app... Even with System.gc littered all over it still hits the out of memory exception goes into my catch, does a system gc and tries to continue.. but why does it do this with 30 meg free? is there a limit on how much ram you can "grab" at any one time?? Can I increase the stack ahead of time?
It appears to run out of memory creating an object written by myself, not neccessarily loading an image.. Ive attached a grab of the mem profiler to show the ram usage... http://www.j2meforums.com/forum/inde....0;id=80;image
Any hints on this would be good, im basically at a loss.