Zach
Zach

Reputation: 10129

App allocation large memory when it loads up

In my android application I found this message in the logs when the app starts up.

Grow heap (frag case) to 13.781MB for 3271696-byte allocation

This happens soon after setContentView() is called and even before other part of the app gets executed.

Why does setting a content view take this much memory?

I am not sure what this means. Can some on explain please?

Thanks

Upvotes: 2

Views: 156

Answers (2)

Joe Plante
Joe Plante

Reputation: 6368

There's no easy answer. How large is the content view? Have you ever used the Eclipse MAT? Also, how large is the screen? Is there an ImageView loading a large image? That's about the size of a *1000x1000 image.

  • Note: miscalculated it earlier.

Upvotes: 2

Ercan
Ercan

Reputation: 3705

setContentView(int res) infilates the layout and adds all top level views you have.

probably images, and other complex views loads your memory this much. consider resizing your images in drawable folder.

Upvotes: 1

Related Questions