15.02.2011 14:41, Jonas Petersson пишет:


Well, I have not double checked for a while now, but the onLowMemory() method of my service was certainly called now and then (even though my service wasn't doing anything at all at the time) last I traced it. Does this qualify?

Best / Jonas

It does qualify, but to a point:

http://developer.android.com/reference/android/content/ComponentCallbacks.html#onLowMemory()
This is called when the overall system is running low on memory, and would like actively running process to try to tighten their belt. While the exact point at which this will be called is not defined, generally it will happen around the time all background process have been killed, that is before reaching the point of killing processes hosting service and foreground UI that we would like to avoid killing.

Note that it says "actively running process", "all background process have been killed", and "before reaching the point of killing processes hosting service and foreground UI" - which I'm reading to mean that this applies to foreground-class processes.

The original question was, are *background* process heaps ever GC'd and shrunk?

Was your service bound to a visible activity, previously called startForeground, or running locally within a foreground process?

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