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.
The
OutOfMemoryErrorhas 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