36

Working on a profiler of my own, I would like to explain what I see. There are some default threads which always appear, even in the simplest program:

  • DestroyJavaVM
  • Signal Dispatcher
  • Finalizer
  • Reference Handler

Although their names are quite self-documenting, I would like to get a little bit more information. It seems these threads are not documented, does someone know a source to dig for these information or even knows exactly what these threads do?

Konrad Reiche
  • 27,743
  • 15
  • 106
  • 143
  • 1
    possible duplicate of [What is the java signal dispatcher thread?](http://stackoverflow.com/questions/235674/what-is-the-java-signal-dispatcher-thread) And also http://stackoverflow.com/questions/2239186/what-are-these-threads-which-are-spwaned-when-a-java-application-begins-its-execu – Brian Roach Apr 23 '11 at 18:25
  • 1
    Existing profilers such as JProfiler seem to cover pretty much every imaginable requirement. I am curious, what is wrong with existing profilers that made you take on developing your own? – Slava Imeshev Jun 07 '11 at 23:55
  • 3
    @Slava-Imeshev: I agree with you, however, I investigate this topic to write about it in my bachelor thesis. – Konrad Reiche Jun 08 '11 at 16:38

1 Answers1

40
  1. DestroyJavaVM is a thread that unloads the Java VM on program exit. Most of the time it should be waiting, until apocalypse of your VM.
  2. Signal Dispatcher is a thread that handles the native signals sent by the OS to your jvm.
  3. Finalizer threads pull objects from the finalization queue and calls it finalize method.
  4. Reference Handler is a high-priority thread to enqueue pending References. Its defined in java.lang.ref.References.java
Community
  • 1
  • 1
Suraj Chandran
  • 24,433
  • 12
  • 63
  • 94