Perhaps this (garbage collection on background applications) actually
does happen but just isn't documented, then freeing memory before
going
into the background is a useful thing.

Yes thats why i want to freeing memory just before going into the
background but I am not getting callback which will get called after
pressing home key. However after reading your reply, now i also have
doubt even if i clear memory ( initialized it with null), it will call
garbage collector or not but it is more better than not releasing
memory at all. if in case garbage collector get run after assigning
null, my purpose will be achieved.


On Feb 15, 4:21 pm, Kostya Vasilyev <kmans...@gmail.com> wrote:
> 15.02.2011 13:50, cool.manish пишет:
>
> > I am storing some data at application level, I want to clear it so
> > that it doesn't consume memory when my application is in background.
>
>  From what I can find in the documentation, it's not clear if this can
> reduce memory consumption.
>
> An application sitting in the background is presumably not running any
> code and not making allocations, so there is nothing to trigger garbage
> collection (and cause the heap allocated by Dalvik VM from the Linux
> kernel to shrink).
>
> Later, if Android runs out of global memory, it's documented that it
> just starts killing background processes in their entirety. It's not
> documented that there is any attempt to run garbage collection on
> background applications' heaps and shrink them to free up global memory.
>
> Perhaps this (garbage collection on background applications) actually
> does happen but just isn't documented, then freeing memory before going
> into the background is a useful thing.
>
> Can this be clarified?
>
> --
> Kostya Vasilyev --http://kmansoft.wordpress.com

-- 
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

Reply via email to