Problem with loading bitmaps into Android Application

Started by
16 comments, last by alexgibson 12 years, 2 months ago
I am designing an Android game, and as the games go, they contain lots of bitmaps.

Mine is not exception and I am loading them via BitmapFactory by the following instruction:

bitmap = BitmapFactory.decodeStream(context.getResources().openRawResource(imageFileIDs[IndexOfBitmapHere]));

Everything goes great, until certain amount of calls to the above instruction - then the app keels over with the Out Of Memory message.

Thing is, that after uploading let say 40 bitmaps of the same size, I have still 70% of Memory Free.

Then I upload just one more additional bitmap of the same size, which should take me comfortably to some 69% and instead all goes bang - OOM !!!

The garbage collector suddenly reports it has only 3-2-1% of memory left, then OOM crash. wacko.png

There is obviously some bug in Android (I am running this on 3.0) and I cannot figure out what it is.

I have tried just about everything and now I am stuck with this annoying issue already 2 weeks.

Does anybody know what causes it and what is the way around ?

Any help is highly appreciated.

Advertisement
Android applications are limited to 16MB/24MB of RAM. See here for finding out how much you have available.

It seems to have been increased somewhat as well.

Does anybody know what causes it and what is the way around ?[/quote]

Reduce size of images, load less images, load on demand, ...

Android applications are limited to 16MB/24MB of RAM.


Obviously you weren't reading my question properly. There is 48MB memory btw in Android 3.0, and some 70% are still free before it all goes balls up!
What about this?
What about this?


Yeah, I also found that few days ago. That does not show how to solve the problem, only shows how to prevent OOM by not loading the bitmap. What kind of lame solution is that?
Are you using LogCat to track the exact nature of the exception and get the stack trace? (It's sometimes not the easiest thing to read but with the latest ADT for Eclipse it is much easier to filter).

When I was seeing our OOM exception LogCat was able to tell me the resource Id i was loading and how much memory it was trying to allocate (With the stack trace it was more than enough to diagnose the cause)? It might be helpful if you post that up (when i saw we were allocating 10 megs just to draw 1 background I knew exactly what was up and resolving it was not an issue).

You are more than likely already aware that the .png's are small in their compressed state but once loaded into memory they are uncompressed bitmaps so will consume (width x height x bytesperpixel) bytes. It is also extremely easy to leak memory in Android but I don't believe this is your issue from your original post.

We had a few issues with the memory management on Android initially but once we refactored our engine to be a bit more Android friendly we were fine.
Thanks Fiallen, for trying to help me with this. You seem to know what are you talking about (as opposed to Antheus above, who just googles and stabs in the dark) rolleyes.gif

This is my first game in Android and I already thought I have a fully working game engine, which I was designing by myself from scratch, and can concentrate on the level design, when this setback with textures, which sent me right back to the square one wacko.png

Are you using LogCat to track the exact nature of the exception and get the stack trace?


Yeah, sure I use that from beginning, it's extremely useful, and now when you mentioned it, I've looked into it really in detail again, but still cannot figure out what I am doing wrong.

When I was seeing our OOM exception LogCat was able to tell me the resource Id i was loading and how much memory it was trying to allocate (With the stack trace it was more than enough to diagnose the cause)? You are more than likely already aware that the .png's are small in their compressed state but once loaded into memory they are uncompressed bitmaps so will consume (width x height x bytesperpixel) bytes. It is also extremely easy to leak memory in Android but I don't believe this is your issue from your original post.


This is where I am really getting confused. I was originally allocating well less than width x height x 4, and it still worked (see first log) and when I increased that significantly, it seemed to make no difference in amount of allocated memory. As you will see from log there is always this magical number 1925136 bytes floating around, even I increase allocation by thousandfold.

For clarity, I am posting 2 logs in following two posts.

1st log is where the game starts fine, about 50 or so textures ranging in size from 80x80 to 1280x752 load just fine and everything works great. This works whether I put to allocation ridiculously small numbers, or their thousedfold values (width * height * 4 does not work, that crashes immediately, but I put there anything from 12 * 4 to width * 4 and it did not seem to make an iota of difference - all textures loaded and game ran). As you can see though there is something strange going on there - it seems like Android is running out of puff there, having 1-2-3% of memory free, then suddenly reclaims up to 71%!

2nd log is the same situation, I did not change memory allocation, only added one more object loading one more 1280x752 texture. That is where it crashes.

I figured that I just can null some texture objects/classes and reinstate them later when I need them, but I cannot figure out how to do it either. See:

http://www.gamedev.n...__fromsearch__1

Either Android/Java is extremely difficult environment, or I am a lousy programmer biggrin.png

I am stuck with this problem now about 2 weeks and will be very grateful if you could show me the way out of this mess.
LOG - NO CRASH

02-01 20:54:58.323: D/dalvikvm(542): GC_FOR_ALLOC freed 48K, 5% free 6254K/6531K, paused 295ms
02-01 20:54:58.391: I/dalvikvm-heap(542): Grow heap (frag case) to 8.034MB for 1925136-byte allocation
02-01 20:54:58.561: D/dalvikvm(542): GC_FOR_ALLOC freed <1K, 4% free 8134K/8455K, paused 60ms
02-01 20:54:58.661: D/dalvikvm(542): GC_CONCURRENT freed <1K, 4% free 8134K/8455K, paused 3ms+2ms
02-01 20:54:59.211: D/dalvikvm(542): GC_EXPLICIT freed 9K, 4% free 8124K/8455K, paused 3ms+5ms
02-01 20:54:59.271: D/dalvikvm(542): GC_FOR_ALLOC freed <1K, 4% free 8145K/8455K, paused 50ms
02-01 20:54:59.291: I/dalvikvm-heap(542): Grow heap (frag case) to 9.889MB for 1925136-byte allocation
02-01 20:54:59.451: D/dalvikvm(542): GC_FOR_ALLOC freed 0K, 4% free 10025K/10375K, paused 69ms
02-01 20:54:59.551: D/dalvikvm(542): GC_CONCURRENT freed <1K, 4% free 10025K/10375K, paused 4ms+2ms
02-01 20:55:00.253: D/dalvikvm(542): GC_EXPLICIT freed 2K, 4% free 10023K/10375K, paused 3ms+5ms
02-01 20:55:00.321: D/dalvikvm(542): GC_FOR_ALLOC freed <1K, 4% free 10043K/10375K, paused 64ms
02-01 20:55:00.344: I/dalvikvm-heap(542): Grow heap (frag case) to 11.746MB for 1925136-byte allocation
02-01 20:55:00.421: D/dalvikvm(542): GC_FOR_ALLOC freed 0K, 4% free 11923K/12295K, paused 48ms
02-01 20:55:00.551: D/dalvikvm(542): GC_CONCURRENT freed 0K, 4% free 11923K/12295K, paused 4ms+2ms
02-01 20:55:01.742: D/dalvikvm(542): GC_EXPLICIT freed <1K, 4% free 11923K/12295K, paused 2ms+3ms
02-01 20:55:01.902: D/dalvikvm(542): GC_FOR_ALLOC freed <1K, 3% free 11944K/12295K, paused 151ms
02-01 20:55:01.954: I/dalvikvm-heap(542): Grow heap (frag case) to 13.601MB for 1925136-byte allocation
02-01 20:55:02.083: D/dalvikvm(542): GC_FOR_ALLOC freed 0K, 3% free 13824K/14215K, paused 98ms
02-01 20:55:02.212: D/dalvikvm(542): GC_CONCURRENT freed <1K, 3% free 13824K/14215K, paused 3ms+2ms
02-01 20:55:02.792: D/dalvikvm(542): GC_EXPLICIT freed <1K, 3% free 13824K/14215K, paused 5ms+3ms
02-01 20:55:02.852: D/dalvikvm(542): GC_FOR_ALLOC freed <1K, 3% free 13845K/14215K, paused 59ms
02-01 20:55:02.872: I/dalvikvm-heap(542): Grow heap (frag case) to 15.458MB for 1925136-byte allocation
02-01 20:55:03.032: D/dalvikvm(542): GC_FOR_ALLOC freed 0K, 3% free 15725K/16135K, paused 69ms
02-01 20:55:03.643: D/dalvikvm(542): GC_EXPLICIT freed <1K, 3% free 15725K/16135K, paused 5ms+3ms
02-01 20:55:03.701: D/dalvikvm(542): GC_FOR_ALLOC freed <1K, 3% free 15746K/16135K, paused 59ms
02-01 20:55:03.732: I/dalvikvm-heap(542): Grow heap (frag case) to 17.314MB for 1925136-byte allocation
02-01 20:55:03.872: D/dalvikvm(542): GC_FOR_ALLOC freed 0K, 3% free 17626K/18055K, paused 57ms
02-01 20:55:04.472: D/dalvikvm(542): GC_EXPLICIT freed <1K, 3% free 17626K/18055K, paused 3ms+5ms
02-01 20:55:04.532: D/dalvikvm(542): GC_FOR_ALLOC freed <1K, 3% free 17646K/18055K, paused 57ms
02-01 20:55:04.552: I/dalvikvm-heap(542): Grow heap (frag case) to 19.170MB for 1925136-byte allocation
02-01 20:55:04.721: D/dalvikvm(542): GC_FOR_ALLOC freed 0K, 3% free 19526K/19975K, paused 77ms
02-01 20:55:05.331: D/dalvikvm(542): GC_EXPLICIT freed <1K, 3% free 19526K/19975K, paused 2ms+3ms
02-01 20:55:05.421: D/dalvikvm(542): GC_EXPLICIT freed <1K, 2% free 19586K/19975K, paused 6ms+3ms
02-01 20:55:05.532: D/dalvikvm(542): GC_EXPLICIT freed <1K, 2% free 19650K/19975K, paused 3ms+3ms
02-01 20:55:05.651: D/dalvikvm(542): GC_EXPLICIT freed <1K, 2% free 19713K/19975K, paused 3ms+3ms
02-01 20:55:05.771: D/dalvikvm(542): GC_EXPLICIT freed <1K, 1% free 19776K/19975K, paused 3ms+3ms
02-01 20:55:05.891: D/dalvikvm(542): GC_EXPLICIT freed <1K, 1% free 19839K/20039K, paused 3ms+2ms
...HERE MANY MORE LINES JUMPING BETWEEN 1-3% free
02-01 20:55:09.311: D/dalvikvm(542): GC_EXPLICIT freed <1K, 3% free 31092K/31751K, paused 6ms+4ms
02-01 20:55:09.441: D/dalvikvm(542): GC_EXPLICIT freed <1K, 3% free 31645K/32327K, paused 4ms+4ms
02-01 20:55:09.571: D/dalvikvm(542): GC_EXPLICIT freed <1K, 3% free 32198K/32903K, paused 2ms+6ms
02-01 20:55:09.691: D/dalvikvm(542): GC_EXPLICIT freed <1K, 1% free 32752K/32903K, paused 2ms+3ms
02-01 20:55:09.881: D/dalvikvm(542): GC_EXPLICIT freed <1K, 1% free 33108K/33287K, paused 2ms+3ms
02-01 20:55:10.061: D/dalvikvm(542): GC_EXPLICIT freed <1K, 1% free 33446K/33671K, paused 2ms+3ms
02-01 20:55:10.321: D/dalvikvm(542): GC_CONCURRENT freed <1K, 1% free 35427K/35655K, paused 9ms+13ms
02-01 20:55:10.481: D/dalvikvm(542): GC_EXPLICIT freed <1K, 1% free 35427K/35655K, paused 3ms+3ms
02-01 20:55:10.721: D/dalvikvm(542): GC_EXPLICIT freed <1K, 1% free 37352K/37639K, paused 3ms+6ms
02-01 20:55:10.801: D/dalvikvm(542): GC_FOR_ALLOC freed <1K, 1% free 37352K/37639K, paused 74ms
02-01 20:55:10.821: I/dalvikvm-heap(542): Grow heap (frag case) to 38.458MB for 1971216-byte allocation
02-01 20:55:11.001: D/dalvikvm(542): GC_FOR_ALLOC freed 0K, 1% free 39277K/39623K, paused 88ms
02-01 20:55:11.252: D/dalvikvm(542): GC_EXPLICIT freed <1K, 1% free 39277K/39623K, paused 3ms+3ms
02-01 20:55:11.321: D/dalvikvm(542): GC_FOR_ALLOC freed <1K, 1% free 39277K/39623K, paused 74ms
02-01 20:55:11.351: I/dalvikvm-heap(542): Grow heap (frag case) to 40.337MB for 1971216-byte allocation
02-01 20:55:11.541: D/dalvikvm(542): GC_FOR_ALLOC freed 0K, 1% free 41202K/41607K, paused 100ms
02-01 20:55:11.791: D/dalvikvm(542): GC_EXPLICIT freed <1K, 1% free 41202K/41607K, paused 3ms+4ms
...HERE MANY MORE LINES 1% free
02-01 20:55:15.521: D/dalvikvm(542): GC_EXPLICIT freed <1K, 1% free 42013K/42119K, paused 3ms+4ms
02-01 20:55:15.811: D/dalvikvm(542): GC_CONCURRENT freed <1K, 1% free 43954K/44103K, paused 9ms+3ms
02-01 20:55:16.281: D/dalvikvm(542): GC_EXPLICIT freed <1K, 1% free 43954K/44103K, paused 5ms+6ms
02-01 20:55:16.951: D/dalvikvm(542): GC_EXPLICIT freed <1K, 1% free 45834K/46023K, paused 3ms+3ms
02-01 20:55:17.501: I/dalvikvm-heap(542): Clamp target GC heap from 48.698MB to 48.000MB
02-01 20:55:17.501: D/dalvikvm(542): GC_EXPLICIT freed <1K, 1% free 47714K/47943K, paused 5ms+3ms
02-01 20:55:17.641: D/MEMORY(542): Max Memory: 49152 KB
02-01 20:55:17.772: D/libEGL(542): egl.cfg not found, using default config
02-01 20:55:17.772: D/libEGL(542): loaded /system/lib/egl/libGLES_android.so
02-01 20:55:17.891: D/LOADED:(542): Start: Level 1
02-01 20:55:19.441: D/SCREEN SIZE(542): ScreenX: 1280, ScreenY: 752
02-01 20:55:19.601: I/ARMAssembler(542): generated scanline__000001B7:030101C4_00001404_00000000 [ 65 ipp] (130 ins) at [0x49a281e8:0x49a283f0] in 3250574 ns
02-01 20:55:19.821: I/ARMAssembler(542): generated scanline__000001B7:035454C4_00001404_00000000 [ 97 ipp] (183 ins) at [0x49a283f8:0x49a286d4] in 1737577 ns
02-01 20:55:19.953: I/ARMAssembler(542): generated scanline__000001B7:035454C4_00009404_00000000 [160 ipp] (246 ins) at [0x49a286d8:0x49a28ab0] in 1681797 ns
02-01 20:55:24.431: I/ARMAssembler(542): generated scanline__000001B7:035454C4_00001401_00000000 [105 ipp] (191 ins) at [0x49a28ab8:0x49a28db4] in 1772941 ns
02-01 20:55:48.503: D/dalvikvm(542): GC_CONCURRENT freed 34563K, 71% free 14376K/49095K, paused 9ms+44ms
02-01 20:56:13.161: D/dalvikvm(542): GC_CONCURRENT freed 1932K, 71% free 14367K/49095K, paused 10ms+16ms
...HERE MANY MORE LINES 71% free
02-01 20:59:33.453: D/dalvikvm(542): GC_CONCURRENT freed 1923K, 71% free 14367K/49095K, paused 3ms+3ms
02-01 21:00:03.051: D/dalvikvm(542): GC_CONCURRENT freed 1923K, 71% free 14367K/49095K, paused 4ms+3ms
LOG - CRASH

02-01 21:00:18.361: D/dalvikvm(596): GC_FOR_ALLOC freed 48K, 5% free 6254K/6531K, paused 341ms
02-01 21:00:18.453: I/dalvikvm-heap(596): Grow heap (frag case) to 8.034MB for 1925136-byte allocation
02-01 21:00:18.551: D/dalvikvm(596): GC_FOR_ALLOC freed <1K, 4% free 8134K/8455K, paused 59ms
02-01 21:00:18.661: D/dalvikvm(596): GC_CONCURRENT freed <1K, 4% free 8134K/8455K, paused 3ms+12ms
02-01 21:00:19.201: D/dalvikvm(596): GC_EXPLICIT freed 9K, 4% free 8124K/8455K, paused 2ms+2ms
02-01 21:00:19.253: D/dalvikvm(596): GC_FOR_ALLOC freed <1K, 4% free 8145K/8455K, paused 53ms
02-01 21:00:19.281: I/dalvikvm-heap(596): Grow heap (frag case) to 9.889MB for 1925136-byte allocation
02-01 21:00:19.432: D/dalvikvm(596): GC_FOR_ALLOC freed 0K, 4% free 10025K/10375K, paused 62ms
02-01 21:00:19.522: D/dalvikvm(596): GC_CONCURRENT freed <1K, 4% free 10025K/10375K, paused 3ms+2ms
02-01 21:00:20.121: D/dalvikvm(596): GC_EXPLICIT freed 2K, 4% free 10023K/10375K, paused 3ms+2ms
02-01 21:00:20.191: D/dalvikvm(596): GC_FOR_ALLOC freed <1K, 4% free 10043K/10375K, paused 63ms
02-01 21:00:20.211: I/dalvikvm-heap(596): Grow heap (frag case) to 11.746MB for 1925136-byte allocation
02-01 21:00:20.291: D/dalvikvm(596): GC_FOR_ALLOC freed 0K, 4% free 11923K/12295K, paused 48ms
02-01 21:00:20.411: D/dalvikvm(596): GC_CONCURRENT freed <1K, 4% free 11923K/12295K, paused 3ms+3ms
02-01 21:00:21.593: D/dalvikvm(596): GC_EXPLICIT freed <1K, 4% free 11923K/12295K, paused 3ms+3ms
02-01 21:00:21.683: D/dalvikvm(596): GC_FOR_ALLOC freed <1K, 3% free 11944K/12295K, paused 90ms
02-01 21:00:21.721: I/dalvikvm-heap(596): Grow heap (frag case) to 13.601MB for 1925136-byte allocation
02-01 21:00:21.871: D/dalvikvm(596): GC_FOR_ALLOC freed 0K, 3% free 13824K/14215K, paused 89ms
02-01 21:00:22.043: D/dalvikvm(596): GC_CONCURRENT freed <1K, 3% free 13824K/14215K, paused 3ms+4ms
02-01 21:00:22.711: D/dalvikvm(596): GC_EXPLICIT freed <1K, 3% free 13824K/14215K, paused 3ms+5ms
02-01 21:00:22.781: D/dalvikvm(596): GC_FOR_ALLOC freed <1K, 3% free 13845K/14215K, paused 60ms
02-01 21:00:22.801: I/dalvikvm-heap(596): Grow heap (frag case) to 15.458MB for 1925136-byte allocation
02-01 21:00:22.941: D/dalvikvm(596): GC_FOR_ALLOC freed 0K, 3% free 15725K/16135K, paused 58ms
02-01 21:00:23.551: D/dalvikvm(596): GC_EXPLICIT freed <1K, 3% free 15725K/16135K, paused 2ms+3ms
02-01 21:00:23.611: D/dalvikvm(596): GC_FOR_ALLOC freed <1K, 3% free 15746K/16135K, paused 56ms
02-01 21:00:23.631: I/dalvikvm-heap(596): Grow heap (frag case) to 17.314MB for 1925136-byte allocation
02-01 21:00:23.801: D/dalvikvm(596): GC_FOR_ALLOC freed 0K, 3% free 17626K/18055K, paused 74ms
02-01 21:00:24.391: D/dalvikvm(596): GC_EXPLICIT freed <1K, 3% free 17626K/18055K, paused 5ms+3ms
02-01 21:00:24.461: D/dalvikvm(596): GC_FOR_ALLOC freed <1K, 3% free 17646K/18055K, paused 59ms
02-01 21:00:24.481: I/dalvikvm-heap(596): Grow heap (frag case) to 19.170MB for 1925136-byte allocation
02-01 21:00:24.661: D/dalvikvm(596): GC_FOR_ALLOC freed 0K, 3% free 19526K/19975K, paused 82ms
02-01 21:00:25.261: D/dalvikvm(596): GC_EXPLICIT freed <1K, 3% free 19526K/19975K, paused 3ms+3ms
02-01 21:00:25.321: D/dalvikvm(596): GC_FOR_ALLOC freed <1K, 3% free 19547K/19975K, paused 60ms
02-01 21:00:25.343: I/dalvikvm-heap(596): Grow heap (frag case) to 21.027MB for 1925136-byte allocation
02-01 21:00:25.511: D/dalvikvm(596): GC_FOR_ALLOC freed 0K, 3% free 21427K/21895K, paused 79ms
02-01 21:00:26.121: D/dalvikvm(596): GC_EXPLICIT freed <1K, 3% free 21427K/21895K, paused 3ms+5ms
02-01 21:00:26.221: D/dalvikvm(596): GC_EXPLICIT freed <1K, 2% free 21487K/21895K, paused 3ms+3ms
02-01 21:00:26.343: D/dalvikvm(596): GC_EXPLICIT freed <1K, 2% free 21550K/21895K, paused 3ms+5ms
02-01 21:00:26.461: D/dalvikvm(596): GC_EXPLICIT freed <1K, 2% free 21614K/21895K, paused 9ms+3ms
02-01 21:00:26.581: D/dalvikvm(596): GC_EXPLICIT freed <1K, 1% free 21677K/21895K, paused 3ms+3ms
02-01 21:00:26.701: D/dalvikvm(596): GC_EXPLICIT freed <1K, 1% free 21740K/21895K, paused 3ms+3ms
02-01 21:00:26.821: D/dalvikvm(596): GC_EXPLICIT freed <1K, 1% free 21803K/21959K, paused 3ms+3ms
02-01 21:00:26.941: D/dalvikvm(596): GC_EXPLICIT freed <1K, 1% free 21866K/22023K, paused 2ms+6ms
...HERE MANY MORE LINES JUMPING BETWEEN 1-3% free
02-01 21:00:30.232: D/dalvikvm(596): GC_EXPLICIT freed <1K, 3% free 32993K/33671K, paused 3ms+6ms
02-01 21:00:30.362: D/dalvikvm(596): GC_EXPLICIT freed <1K, 3% free 33546K/34247K, paused 2ms+4ms
02-01 21:00:30.492: D/dalvikvm(596): GC_EXPLICIT freed <1K, 1% free 34099K/34247K, paused 3ms+3ms
02-01 21:00:30.622: D/dalvikvm(596): GC_EXPLICIT freed <1K, 1% free 34653K/34823K, paused 3ms+3ms
02-01 21:00:30.814: D/dalvikvm(596): GC_EXPLICIT freed <1K, 1% free 35009K/35207K, paused 2ms+3ms
02-01 21:00:30.992: D/dalvikvm(596): GC_EXPLICIT freed <1K, 1% free 35346K/35591K, paused 2ms+3ms
02-01 21:00:31.072: D/dalvikvm(596): GC_FOR_ALLOC freed <1K, 1% free 35402K/35591K, paused 78ms
02-01 21:00:31.311: D/dalvikvm(596): GC_EXPLICIT freed <1K, 1% free 37327K/37575K, paused 3ms+4ms
02-01 21:00:31.383: D/dalvikvm(596): GC_FOR_ALLOC freed <1K, 1% free 37327K/37575K, paused 74ms
02-01 21:00:31.411: I/dalvikvm-heap(596): Grow heap (frag case) to 38.434MB for 1971216-byte allocation
02-01 21:00:31.601: D/dalvikvm(596): GC_FOR_ALLOC freed 0K, 1% free 39252K/39559K, paused 95ms
02-01 21:00:31.801: D/dalvikvm(596): GC_EXPLICIT freed <1K, 1% free 39253K/39559K, paused 5ms+3ms
02-01 21:00:31.911: D/dalvikvm(596): GC_FOR_ALLOC freed <1K, 1% free 39253K/39559K, paused 100ms
02-01 21:00:31.931: I/dalvikvm-heap(596): Grow heap (frag case) to 40.314MB for 1971216-byte allocation
02-01 21:00:32.121: D/dalvikvm(596): GC_FOR_ALLOC freed 0K, 1% free 41178K/41543K, paused 99ms
02-01 21:00:32.371: D/dalvikvm(596): GC_EXPLICIT freed <1K, 1% free 41178K/41543K, paused 2ms+4ms
02-01 21:00:32.441: D/dalvikvm(596): GC_FOR_ALLOC freed <1K, 1% free 41178K/41543K, paused 78ms
02-01 21:00:32.471: I/dalvikvm-heap(596): Grow heap (frag case) to 42.194MB for 1971216-byte allocation
02-01 21:00:32.681: D/dalvikvm(596): GC_FOR_ALLOC freed 0K, 1% free 43103K/43527K, paused 114ms
...HERE MANY MORE LINES JUMPING BETWEEN 1% free
02-01 21:00:36.701: D/dalvikvm(596): GC_EXPLICIT freed <1K, 1% free 43914K/44039K, paused 3ms+3ms
02-01 21:00:36.951: D/dalvikvm(596): GC_CONCURRENT freed <1K, 1% free 45855K/46023K, paused 4ms+3ms
02-01 21:00:37.423: D/dalvikvm(596): GC_EXPLICIT freed <1K, 1% free 45855K/46023K, paused 3ms+4ms
02-01 21:00:38.141: I/dalvikvm-heap(596): Clamp target GC heap from 48.717MB to 48.000MB
02-01 21:00:38.141: D/dalvikvm(596): GC_EXPLICIT freed <1K, 1% free 47735K/47943K, paused 3ms+6ms
02-01 21:00:38.241: I/dalvikvm-heap(596): Clamp target GC heap from 48.718MB to 48.000MB
02-01 21:00:38.241: D/dalvikvm(596): GC_FOR_ALLOC freed <1K, 1% free 47735K/47943K, paused 100ms
02-01 21:00:38.241: I/dalvikvm-heap(596): Forcing collection of SoftReferences for 1925136-byte allocation
02-01 21:00:38.351: I/dalvikvm-heap(596): Clamp target GC heap from 48.716MB to 48.000MB
02-01 21:00:38.351: D/dalvikvm(596): GC_BEFORE_OOM freed 1K, 1% free 47734K/47943K, paused 109ms
[color=#ff0000]02-01 21:00:38.351: E/dalvikvm-heap(596): Out of memory on a 1925136-byte allocation.
02-01 21:00:38.351: I/dalvikvm(596): "main" prio=5 tid=1 RUNNABLE
02-01 21:00:38.351: I/dalvikvm(596): | group="main" sCount=0 dsCount=0 obj=0x4001e6b0 self=0x115b8
02-01 21:00:38.351: I/dalvikvm(596): | sysTid=596 nice=0 sched=0/0 cgrp=default handle=-1342909328
02-01 21:00:38.361: I/dalvikvm(596): | schedstat=( 16874792266 2631344068 909 ) utm=1557 stm=130 core=0
02-01 21:00:38.361: I/dalvikvm(596): at android.graphics.BitmapFactory.nativeDecodeAsset(Native Method)
02-01 21:00:38.361: I/dalvikvm(596): at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:483)
02-01 21:00:38.361: I/dalvikvm(596): at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:549)
02-01 21:00:38.361: I/dalvikvm(596): at Atomix.apk.Background.<init>(Background.java:57)
02-01 21:00:38.361: I/dalvikvm(596): at Atomix.apk.GLRenderer.<init>(GLRenderer.java:65)
02-01 21:00:38.361: I/dalvikvm(596): at Atomix.apk.AtomixActivity.onCreate(AtomixActivity.java:49)
02-01 21:00:38.361: I/dalvikvm(596): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1048)
02-01 21:00:38.361: I/dalvikvm(596): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1700)
02-01 21:00:38.361: I/dalvikvm(596): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1752)
02-01 21:00:38.361: I/dalvikvm(596): at android.app.ActivityThread.access$1500(ActivityThread.java:123)
02-01 21:00:38.361: I/dalvikvm(596): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:993)
02-01 21:00:38.361: I/dalvikvm(596): at android.os.Handler.dispatchMessage(Handler.java:99)
02-01 21:00:38.361: I/dalvikvm(596): at android.os.Looper.loop(Looper.java:126)
02-01 21:00:38.361: I/dalvikvm(596): at android.app.ActivityThread.main(ActivityThread.java:3997)
02-01 21:00:38.361: I/dalvikvm(596): at java.lang.reflect.Method.invokeNative(Native Method)
02-01 21:00:38.361: I/dalvikvm(596): at java.lang.reflect.Method.invoke(Method.java:491)
02-01 21:00:38.361: I/dalvikvm(596): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:841)
02-01 21:00:38.361: I/dalvikvm(596): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:599)
02-01 21:00:38.361: I/dalvikvm(596): at dalvik.system.NativeStart.main(Native Method)
02-01 21:00:38.371: D/skia(596): --- decoder->decode returned false
02-01 21:00:38.371: D/AndroidRuntime(596): Shutting down VM
02-01 21:00:38.371: W/dalvikvm(596): threadid=1: thread exiting with uncaught exception (group=0x40014760)
[color=#ff0000]02-01 21:00:38.381: E/AndroidRuntime(596): FATAL EXCEPTION: main
02-01 21:00:38.381: E/AndroidRuntime(596): java.lang.OutOfMemoryError
02-01 21:00:38.381: E/AndroidRuntime(596): at android.graphics.BitmapFactory.nativeDecodeAsset(Native Method)
02-01 21:00:38.381: E/AndroidRuntime(596): at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:483)
02-01 21:00:38.381: E/AndroidRuntime(596): at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:549)
02-01 21:00:38.381: E/AndroidRuntime(596): at Atomix.apk.Background.<init>(Background.java:57)
02-01 21:00:38.381: E/AndroidRuntime(596): at Atomix.apk.GLRenderer.<init>(GLRenderer.java:65)
02-01 21:00:38.381: E/AndroidRuntime(596): at Atomix.apk.AtomixActivity.onCreate(AtomixActivity.java:49)
02-01 21:00:38.381: E/AndroidRuntime(596): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1048)
02-01 21:00:38.381: E/AndroidRuntime(596): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1700)
02-01 21:00:38.381: E/AndroidRuntime(596): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1752)
02-01 21:00:38.381: E/AndroidRuntime(596): at android.app.ActivityThread.access$1500(ActivityThread.java:123)
02-01 21:00:38.381: E/AndroidRuntime(596): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:993)
02-01 21:00:38.381: E/AndroidRuntime(596): at android.os.Handler.dispatchMessage(Handler.java:99)
02-01 21:00:38.381: E/AndroidRuntime(596): at android.os.Looper.loop(Looper.java:126)
02-01 21:00:38.381: E/AndroidRuntime(596): at android.app.ActivityThread.main(ActivityThread.java:3997)
02-01 21:00:38.381: E/AndroidRuntime(596): at java.lang.reflect.Method.invokeNative(Native Method)
02-01 21:00:38.381: E/AndroidRuntime(596): at java.lang.reflect.Method.invoke(Method.java:491)
02-01 21:00:38.381: E/AndroidRuntime(596): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:841)
02-01 21:00:38.381: E/AndroidRuntime(596): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:599)
02-01 21:00:38.381: E/AndroidRuntime(596): at dalvik.system.NativeStart.main(Native Method)

Thanks Fiallen, for trying to help me with this. You seem to know what are you talking about (as opposed to Antheus above, who just googles and stabs in the dark) rolleyes.gif


I googled because your description of the problem was simplistic at the level of someone spent last two weeks pressing the same button expecting different result.

To get an informed answer, provide a list of things that you've tried and result, along with various other attempts at the solution, links to bug reports and everything else.

While you're at it, lose the entitled and arrogant attitude. That DOES make you a lousy programmer.

This is a free for all forum, not your personal help line.

This topic is closed to new replies.

Advertisement