Do you use Drawable's by any chance? See also http://groups.google.com/group/android-developers/browse_thread/thread/4ed17d7e48899b26/ I had plenty of memory allocation problems on the G1 until I started using BitmapFactory.decodeResource(getResources() instead of getResources().getDrawable(). Also, try to avoid static loading of images that you can also load dynamically, one by one, when needed while releasing the ones that you do not need at any given moment. Finally, calling System.gc() when loading a new image does no harm and might help the garbage collector to stay further away from the heap limits.
On Nov 13, 6:10 am, EboMike <[EMAIL PROTECTED]> wrote: > I'm getting this error too pretty often (mostly after changing > orientation a few times). I just have a Gallery with up to three > images visible at the same time, and one ImageSwitcher with images > that are typically 1024x768 in size or less. I'm using the Heap view > in Eclipse, and there's tons of memory available (not sure if > fragmentation is an issue, the Heap view doesn't have any information > on that). > > That surely can't be touching the limits of the VM - how am I supposed > to get this working? I could be more aggressive in disposing objects, > but since I don't have any lingering references to anything, and the > gc kicks in whenever memory is low (as LogCat clearly indicates), I > don't see why this should be necessary. > > My LogCat says: > > 11-13 05:02:21.602: DEBUG/dalvikvm(31410): GC freed 1351 objects / > 597328 bytes in 69ms > 11-13 05:02:24.200: DEBUG/dalvikvm(47): GC freed 4402 objects / 275688 > bytes in 116ms > 11-13 05:02:27.691: DEBUG/dalvikvm(31410): GC freed 860 objects / > 347368 bytes in 61ms > 11-13 05:02:31.151: DEBUG/dalvikvm(31410): GC freed 591 objects / > 196624 bytes in 76ms > 11-13 05:02:32.781: ERROR/dalvikvm-heap(31410): 1134000-byte external > allocation too large for this process. > 11-13 05:02:32.781: ERROR/(31410): VM won't let us allocate 1134000 > bytes > 11-13 05:02:32.781: DEBUG/skia(31410): xxxxxxxxxxxxxxxxxxxx > allocPixelRef failed --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~----------~----~----~----~------~----~------~--~---

