0

I am trying to understand what all thread runs when I start the application. I created a simple application in Android Studio, no extra line of code added, it is just a plain simple Hello World application which android studio creates.

When I run the adb shell ps and grep for my application UID, I see the following output:

C:\Users>adb shell ps -t | findstr u0_a110

u0_a110 3596 655 1593724 66480 SyS_epoll_ 0000000000 S com.example.rhbj36.myapplication

u0_a110 3601 3596 1593724 66480 futex_wait 0000000000 S Jit thread pool

u0_a110 3602 3596 1593724 66480 do_sigtime 0000000000 S Signal Catcher

u0_a110 3603 3596 1593724 66480 poll_sched 0000000000 S JDWP

u0_a110 3604 3596 1593724 66480 futex_wait 0000000000 S ReferenceQueueD

u0_a110 3605 3596 1593724 66480 futex_wait 0000000000 S FinalizerDaemon

u0_a110 3606 3596 1593724 66480 futex_wait 0000000000 S FinalizerWatchd

u0_a110 3607 3596 1593724 66480 futex_wait 0000000000 S HeapTaskDaemon

u0_a110 3608 3596 1593724 66480 binder_thr 0000000000 S Binder:3596_1

u0_a110 3609 3596 1593724 66480 binder_thr 0000000000 S Binder:3596_2

u0_a110 3610 3596 1593724 66480 futex_wait 0000000000 S Profile Saver

u0_a110 3612 3596 1593724 66480 SyS_epoll_ 0000000000 S RenderThread

u0_a110 3613 3596 1593724 66480 binder_thr 0000000000 S Binder:3596_3

u0_a110 3614 3596 1593724 66480 futex_wait 0000000000 S hwuiTask1

Can someone please help to understand what these 'Binder:3596_1,2,3' threads are? and why they are created? Explanation to other threads will also be helpful.

Onik
  • 19,396
  • 14
  • 68
  • 91
Amol K
  • 165
  • 3
  • 12

1 Answers1

0

Android apps are not like apps in other operating systems. You do not have a main entry point (or equivalent.) Your app is started and stopped by the system on demand, triggered by a small handful of sources, such as Intent. Even though you may have only written a simple Hello World type app, there is a lot going on in the framework to get your app started and on screen.

The main (UI) thread of your app is where your various callbacks are executed (such as onCreate for your Activity.) This is all driven by the framework using Android's IPC mechanism, Binder. So the Binder threads you noticed are automatically created by the framework to handle different requests. Some of these are triggered by things like lifecycle callbacks (controlled by the system), others can be used to handle your own custom Service APIs, etc. Binder automatically sets up a pool of threads to handle incoming requests.

The other threads are similarly used by the system for different things, such as:

  • hwuiTask1: used for graphics / UI offloading
  • RenderThread: used for rendering the app's UI components via HW composer
  • JDWP: Java debug thread, used to attach debugger
  • Profile Saver: Used for app profiling

You normally do not need to be concerned with these threads as they are completely managed by the system and their use will vary depending on the version of Android your app is executing under.

For more details about Android app processes and threads, see this: https://developer.android.com/guide/components/processes-and-threads.html

Larry Schiefer
  • 15,687
  • 2
  • 27
  • 33