Taruni
Taruni

Reputation: 1671

OutOfMemory on both device and emulator

I am getting OutOfMemory Exception while running my project on both emulator and device(acer tablet and samsung galaxy) showing

the application launcher process com.android.launcher has stopped unexpectedly.

I've increase the virtual machine size of emulator to 256mb still there was no change in that exception. How can I avoid this exception? And how can I increase the process size of the heap for both emulator and device?

Please refer to this question

Upvotes: 5

Views: 849

Answers (2)

ProjectJourneyman
ProjectJourneyman

Reputation: 3606

Unless you're doing something extreme and actually need lots of memory, you shouldn't have to resort to increasing the memory footprint. The bug that's causing this will probably run over any additional memory you give it.

Take a closer look at what comes before the out-of-memory error. I recently saw that one because I caused an endless configuration change loop. The only thing that stopped that endless loop was running out of memory.

While the few lines above the error looked fine, I realized that the number of log entries was much higher than normal, because it ran through the initialization for my activity repeatedly.

Your issue may be different, but I'm fairly sure that increasing the heap size won't fix it.

Upvotes: 0

Peter Fortuin
Peter Fortuin

Reputation: 5240

I don't know what kind of application you are running, but it's possible that you have a memory leak in your application. Then it would not matter how big you set your virtual machine size.

Check out the video below on how to find memory leaks in your own application. Works on devices and emulators. (I found a very big memory leak last week, that I didn't know I had in the application)

http://www.youtube.com/watch?v=_CruQY55HOk&feature=player_embedded

Upvotes: 5

Related Questions