Kai
Kai

Reputation: 3865

Android's per-application max heap size

Android has a heap size limit for each app. It could be 16M, 24M, 32M, etc. My question is, will the size of the app itself is taken into account in the heap size limit?

For example, suppose the Android max heap size per-app is 16M. And my app is 10M bytes in size. Does it mean the OS will only leave the app 6M bytes heap after the app is running?

Thanks.

Upvotes: 1

Views: 784

Answers (2)

Thierry Roy
Thierry Roy

Reputation: 8512

No. Your app is made of classes and drawable that will be loaded into memory at run time only when you use it. So for example let's say your app contains drawable that are for tablets, they are not loaded into the memory of a phone.

Upvotes: 1

Vit Khudenko
Vit Khudenko

Reputation: 28418

No, you'll have all 16M of heap.

Things that eat the heap are classes loaded in RAM, and objects created in RAM during the app session.

Upvotes: 1

Related Questions