On Sun, Jul 29, 2012 at 5:45 PM, bob <[email protected]> wrote:

> Worried about memory?  Try this:
> <application android:largeHeap="true">
>

No.

First of all, this only helps you on higher-end devices that have lots of
memory to give you.  So you still need to look at the memory available and
make sure you don't exceed it, and the limit may not be any more than you
have now.  So this actually requires that you do *more* work on memory
management.

Second, let's look at the documentation:
http://developer.android.com/guide/topics/manifest/application-element.html#largeHeap


In particular: "Most apps should not need this and should instead focus on
reducing their overall memory usage for improved performance."

And if you follow the link to getLargeMemoryClass():
http://developer.android.com/reference/android/app/ActivityManager.html#getLargeMemoryClass()

We'll further emphasize this: "This is the space available for
memory-intensive applications; most applications should not need this
amount of memory, and should instead stay with the getMemoryClass() limit."

This API does not "solve" your memory problems.  You are programming for a
mobile, battery-powered, memory-constrained device.  Part of that is tight
memory management.  You don't get to shove an attribute in your manifest
and abdicate on that responsibility.

-- 
Dianne Hackborn
Android framework engineer
[email protected]

Note: please don't send private questions to me, as I don't have time to
provide private support, and so won't reply to such e-mails.  All such
questions should be posted on public forums, where I and others can see and
answer them.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to