java.lang.OutOfMemoryError: bitmap size exceeds VM budget

by Matt Kanninen » Thu, 26 Nov 2009 01:37:20 GMT


Sponsored Links
 This:
        private static final int[] glowDrawableIds={
                R.drawable.graphic_microphoneglow_01,
                R.drawable.graphic_microphoneglow_02,
                R.drawable.graphic_microphoneglow_03,
                R.drawable.graphic_microphoneglow_04,
                R.drawable.graphic_microphoneglow_05,
                R.drawable.graphic_microphoneglow_06,
                R.drawable.graphic_microphoneglow_07,
                R.drawable.graphic_microphoneglow_08,
                R.drawable.graphic_microphoneglow_09,
                R.drawable.graphic_microphoneglow_10
        };
...
View glow = findViewById(R.id.glow);
..

glow.setBackgroundResource(glowDrawableIds[scale]);

is causing

11-25 09:21:02.046: WARN/UsageStats(1018): Failed to persist new stats
11-25 09:21:02.694: DEBUG/dalvikvm(2386): GC freed 298 objects / 15656
bytes in 61ms
11-25 09:21:02.952: ERROR/dalvikvm-heap(2386): 1111680-byte external
allocation too large for this process.
11-25 09:21:02.952: ERROR/(2386): VM won't let us allocate 1111680
bytes
11-25 09:21:02.952: DEBUG/AndroidRuntime(2386): Shutting down VM
11-25 09:21:02.952: WARN/dalvikvm(2386): threadid=3: thread exiting
with uncaught exception (group=0x4001b180)
11-25 09:21:02.952: ERROR/AndroidRuntime(2386): Uncaught handler:
thread main exiting due to uncaught exception
11-25 09:21:03.014: ERROR/AndroidRuntime(2386):
java.lang.OutOfMemoryError: bitmap size exceeds VM budget
11-25 09:21:03.014: ERROR/AndroidRuntime(2386):     at
android.graphics.Bitmap.nativeCreate(Native Method)
11-25 09:21:03.014: ERROR/AndroidRuntime(2386):     at
android.graphics.Bitmap.createBitmap(Bitmap.java:468)
11-25 09:21:03.014: ERROR/AndroidRuntime(2386):     at
android.graphics.Bitmap.createBitmap(Bitmap.java:435)
11-25 09:21:03.014: ERROR/AndroidRuntime(2386):     at
android.graphics.Bitmap.createScaledBitmap(Bitmap.java:340)
11-25 09:21:03.014: ERROR/AndroidRuntime(2386):     at
android.graphics.BitmapFactory.finishDecode(BitmapFactory.java:488)
11-25 09:21:03.014: ERROR/AndroidRuntime(2386):     at
android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:462)
11-25 09:21:03.014: ERROR/AndroidRuntime(2386):     at
android.graphics.BitmapFactory.decodeResourceStream(BitmapFactory.java:
323)
11-25 09:21:03.014: ERROR/AndroidRuntime(2386):     at
android.graphics.drawable.Drawable.createFromResourceStream
(Drawable.java:697)
11-25 09:21:03.014: ERROR/AndroidRuntime(2386):     at
android.content.res.Resources.loadDrawable(Resources.java:1705)
11-25 09:21:03.014: ERROR/AndroidRuntime(2386):     at
android.content.res.Resources.getDrawable(Resources.java:580)
11-25 09:21:03.014: ERROR/AndroidRuntime(2386):     at
android.view.View.setBackgroundResource(View.java:7187)

--



java.lang.OutOfMemoryError: bitmap size exceeds VM budget

by Amit » Thu, 17 Jun 2010 15:08:00 GMT


 Hi

java.lang.OutOfMemoryError: bitmap size exceeds VM budget
I am getting this message in my log. As I investigated and found out
while loading contact image this error comes.I checked  size of the
image file and it was normal so came to a conclusion that other
processes filling up the memory and hence at the time this image is
being loaded ,VM running low of memory.

My question is that, is there any tool to figure out which process is
responsible for occupying memory so that we can look into the process
for the exact reason.

Thanks,
Amit

--


Sponsored Links


Other Threads

1. Randomly closing app - InputManagerService: Got RemoteException sending setActive(false) notification

Hi all,

I've a very simple app, similar to fingerpaint application. I'm
drawing some lines on the screen with my finger.

My problem is that, app closes itself randomly, taking me back to
Android home screen.

Only log I can see on LogCat is that line:

(Warning) Tag: InputManagerService: Got RemoteException sending
setActive(false) notification to pid 4962 uid 10077.

No exception is thrown.

I've tried compiling project against Android 2.0, 2.1 and 2.2...

I've tried disabling debuggable attribute in manifest.

I'm having this problem on both Nexus One and 2.2 Emulator.

Any help is appreciated.

Thanks in advance.

-- 

2. show map intent shows my location first, take a look

Hi, I have found this erroneous behaviour on my phone, please let me know if
you have any idea how to resolve it:

I am trying to open a google maps intent using the following URI:

geo:latitude,longitude?z=zoom

However, when I open this intent, the gps on the device starts and google
maps first displays my location instead of the location in the URI. This
happens only the first time you open google maps. If I go back to my app and
make the same selection , then the correct position on the map appears.

I tried using something like this: geo:0,0?q=*business+near+city, however
this doesnt centers the map on a position, but in the nearest address.*
**
*Any ideas?*

-- 

3. Wrong API reference doc?

4. Image Saving Small Size

5. "Uninstall Updates" functionality

6. Game development

7. Kasian ya Adroid?