onLowMemory() is called when the entire system is running out of
memory, not when your process is running out of memory. Each app is
limited to a fixed amount of RAM (24 MB on a Nexus One for instance).
If you use up these 24 MB but the system still has more RAM available,
you will get an OutOfMemoryError but not onLowMemory().

On Tue, Apr 6, 2010 at 12:27 AM, Atul Moglewar <[email protected]> wrote:
> Hi,
>
> I'm working on an application which allocates lot of memory and hence
> I'm bound to get OutOfMemory. I want a way to get notified when system
> is running short of memory so that I can stop processing further,
> notify user and release as much memory as possible.
>
> According to official Android documentation there is a callback
> onLowMemory from the system. I have a class which extends
> android.app.Application and I have overridden onLowMemory() method.
> This class has entry in the in the application tag of AndroidManifest.
> However it never gets called in my case.  Do I need to register for
> this event using AndroidManifest or any other means?
>
> Thanks,
> Atul
>
> --
> 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
>
> To unsubscribe, reply using "remove me" as the subject.
>



-- 
Romain Guy
Android framework engineer
[email protected]

Note: please don't send private questions to me, as I don't have time
to provide private support.  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