Question

I have a test for my Android application, and it's running without problems. But when I added clickOnView for one button it failed after clicking, Like:

Test run failed: Instrumentation run failed due to 'java.lang.OutOfMemoryError' bitmap size exceeds VM budget

Do you have any ideas why can this be happening? Should I create another AVD with bigger SD-card size? In the one I'm using I have 128MB.

Was it helpful?

Solution

The OutOfMemoryError has nothing to do with the AVM you created nor the SD-card you have set up.

The amount of memory used to handle your bitmaps is simple too big. You probably use bitmaps that are too big in dimension and/or too many of them.

You should check how you handle bitmaps in your application and/or test and see if you can improve them.

Useful reading: Displaying Bitmaps Efficiently

OTHER TIPS

Well, here's the solution, maybe it's gonna be useful for somebody. In my AVD properties I've changed the Max VM application heap size to 64 (it used to be 24), and the problem is gone.

Please goto your project properties-->java build path hit on order and Export tab mark 1.yourProject/src 2.yourProject/gen hit on libraries make sure acra file in list hit on ok then clean your project.. and run it..

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top