What do the different (HotSpot) JVM thread types do?
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 thread type is doing what exactly. Here is what I understood so far:
Additional question: what about other JVMs?
You can find a brief explanation on the OpenJDK website:
The main kinds of VM threads are as follows:
You might want to read the whole Thread Management paragraph since it continues further explanations, eg what the VM thread is responsible for.
Ok, thanks to comments, we have the beginning of an answer:
1) Since the garbage collector has a stop-the-world mecanism, there exist besides tunings two ways to reduce these pauses:
2) The CompilerThread runs the Just-In-Time compiler.
3) The WatcherThread simulates timer interrupts every 50ms to run periodic operations in the VM.
And I would add that there are 7 threads type in JVM! Don't miss os_thread
path: Defined in: /hotspot/src/share/vm/runtime/os.hpp
enum ThreadType {
vm_thread,
cgc_thread, // Concurrent GC thread
pgc_thread, // Parallel GC thread
java_thread, // Java, CodeCacheSweeper, JVMTIAgent and Service threads.
compiler_thread,
watcher_thread,
os_thread
};
链接地址: http://www.djcxy.com/p/79388.html
上一篇: 多处理:比cpu.count更多的进程