Abdulraheem Taha
Abdulraheem Taha

Reputation: 43

Why does my android app have a maximum RAM limit as 64 MB?

I'm developing an android app that has a lot of bitmaps that uses a lot of RAM. My question is that when I keep my app running for a long time and the ram usage exceeds 64 MB, the app crashes with an "OUT OF MEMORY ERROR, VM won't let us allocate ... etc".

While other apps such as facebook reaches 200 MB ram sometimes without any crashes and with a very fast performance. My device is Galaxy S II.

and please notice that my question is not about reducing the memory usage, it's about the difference in memory limit between my app and other apps.

Thanks.

Upvotes: 1

Views: 3264

Answers (2)

Ken
Ken

Reputation: 2355

The amount of memory that the vm is reserving for each application is not part of the Android ecosystem and can't be determined, it's part of the configuration given by the manufacturer.

Usually the last word about the memory size for each vm is given by the file build.prop.

Do not use the NDK trick if you do not know what are you doing.

Upvotes: 0

0909EM
0909EM

Reputation: 5027

I think there is a limit on the amount of memory that an application can use... Used to be 32MB... There might be a permission that you can change to request more memory, in the same way that you can request hardware acceleration. From a quick google android:largeHeap="true" might be your answer... Also Runtime.getRuntime().maxMemory(); might help? This link was also interesting...

Upvotes: 1

Related Questions