What do the different (HotSpot) JVM thread types do?

前端 未结 3 1701
一生所求
一生所求 2020-12-20 11:37

I see there are six thread types implemented into the HotSpot JVM: VMThread, CGCThread, PGCThread, JavaThread, CompilerThread and WatcherThread. However I don\'t know which

3条回答
  •  醉话见心
    2020-12-20 12:36

    You can find a brief explanation on the OpenJDK website:

    The main kinds of VM threads are as follows:

    • VM thread: This singleton instance of VMThread is responsible for executing VM operations, which are discussed below
    • Periodic task thread: This singleton instance of WatcherThread simulates timer interrupts for executing periodic operations within the VM
    • GC threads: These threads, of different types, support parallel and concurrent garbage collection
    • Compiler threads: These threads perform runtime compilation of bytecode to native code
    • Signal dispatcher thread: This thread waits for process directed signals and dispatches them to a Java level signal handling method

    You might want to read the whole Thread Management paragraph since it continues further explanations, e.g. what the VM thread is responsible for.

提交回复
热议问题