For the benefit of all the other applications, you *always* should :) Anyway, maybe Runtime.freeMemory() can help... http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Runtime.html#freeMemory() --- sergi.ve...@gmail.com ["In theory, theory and practice are the same. In practice, they are not."]
On Tue, Dec 16, 2008 at 17:43, Cheryl Sedota <cherylsed...@gmail.com> wrote: > > How can an activity detect that its application/process is about to > run out of memory? > > The 'onLowMemory' API only seems to get called when the system is > running low on memory but I'd like to be able to determine when my > activity itself needs to tighten its belt to avoid an OutOfMemoryError > because the application heap has exceeded the 16MB limit. > > Thanks!! > Cheryl > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~----------~----~----~----~------~----~------~--~---