[android-developers] Are processes kept alive when nothing is being done?

2010-02-08 Thread Al Sutton
I have an app which declares a BroadcastReceiver, the receiver gets
the broadcast, does what it needs to, then ends ensuring that
everything is tidied up as needed. When I examine the system through
the DDMS view in Eclipse the process for the application is still
running after the receiver has completed. I've even boiled it down to
a simple test case which gets a shared preferences instance from the
context, checks a random setting, and then exits, and, when run on the
1.5 emulator (which is the minimum supported OS level) the process is
still hanging around.

The reason this is an issue is memory usage (which shows under DDMS as
around 2MB). I've had queries about why the application still uses up
memory even when it's not doing anything, so, my question is; Is this
behaviour normal, or have I missed something that would make the
process exit?

Al.

btw, DDMS shows only 7 threads;

main (status: wait)
HeapWorker (vmwait)
Signal Catcher (vmwait)
JDWP (running)
Binder Thread #1, #2, and #3 (all native)

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


Re: [android-developers] Are processes kept alive when nothing is being done?

2010-02-08 Thread Dianne Hackborn
Yes this is normal.  Process management is explained here:

http://developer.android.com/guide/topics/fundamentals.html#proclife

http://developer.android.com/guide/topics/fundamentals.html#proclifeKeeping
it around has no negative impact on the user.  People who are complaining
about this, frankly, don't know what they are talking about.  There is a lot
of mis-information flying around as people promote the use of these
task-killers as a cure for imaginary problems.  (I'm not saying that they
don't help in some cases but the cases where they do help -- blowing away
running services -- often actually cause other problems, and are not
applicable here.)

On Mon, Feb 8, 2010 at 1:48 AM, Al Sutton a...@funkyandroid.com wrote:

 I have an app which declares a BroadcastReceiver, the receiver gets
 the broadcast, does what it needs to, then ends ensuring that
 everything is tidied up as needed. When I examine the system through
 the DDMS view in Eclipse the process for the application is still
 running after the receiver has completed. I've even boiled it down to
 a simple test case which gets a shared preferences instance from the
 context, checks a random setting, and then exits, and, when run on the
 1.5 emulator (which is the minimum supported OS level) the process is
 still hanging around.

 The reason this is an issue is memory usage (which shows under DDMS as
 around 2MB). I've had queries about why the application still uses up
 memory even when it's not doing anything, so, my question is; Is this
 behaviour normal, or have I missed something that would make the
 process exit?

 Al.

 btw, DDMS shows only 7 threads;

 main (status: wait)
 HeapWorker (vmwait)
 Signal Catcher (vmwait)
 JDWP (running)
 Binder Thread #1, #2, and #3 (all native)

 --
 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.comandroid-developers%2bunsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en




-- 
Dianne Hackborn
Android framework engineer
hack...@android.com

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