android-profiler

What are the threads shown in the Android Studio Application Profiler responsible for?


I want to profile my app but I'm not sure what every thread do. Of course I can suppose about the most "meaningful" threads role but some threads responsibility are still unclear for me. E.g. what is "crap"-thread and "Studio:socket" threads? Also what threads are deserve attention while profiling? By the way it's really strange for me that number of threads are not the same for emulator and physical devise:

Emulator, Run: Emulator, Run

Physical device, Run Physical device, Run

Where can I find descriptions of these threads? I had tried to Google it but without success.


Solution

  • The Studio: threads are threads started by Android Studio's JVMTI agent, useful for capturing performance-related app data and sending them to the Android Studio profiler. If you don't want to see them or want to minimize their performance impact on your app, you can build your app with the profileable tag. This way the JVMTI agent won't be attached but you will lose some profiler functionality.

    As for the crap.coldshower thread, it's a truncated string because Linux thread names are capped at 15 characters. The full name is likely some package name com.xxxcrap.coldshower, usually the main thread of an app.