java什么时候新建进程_创建名为“ {java}”的线程(即轻量级进程)是为了什么?...
小編典典
所有這些線程都屬于JVM。
運(yùn)行jstack 以獲取線程列表。
"main" #1 prio=5 os_prio=0 cpu=150.00ms elapsed=8.04s tid=0x00007f9f90011000 nid=0x107 waiting on condition [0x00007f9f99f9f000]
java.lang.Thread.State: TIMED_WAITING (sleeping)
at java.lang.Thread.sleep(java.base@11.0.1/Native Method)
at java.lang.Thread.sleep(java.base@11.0.1/Thread.java:339)
at java.util.concurrent.TimeUnit.sleep(java.base@11.0.1/TimeUnit.java:446)
at com.mycompany.app.Main.main(Main.java:10)
"Reference Handler" #2 daemon prio=10 os_prio=0 cpu=0.00ms elapsed=7.95s tid=0x00007f9f901f9000 nid=0x10e waiting on condition [0x00007f9f6c10f000]
java.lang.Thread.State: RUNNABLE
at java.lang.ref.Reference.waitForReferencePendingList(java.base@11.0.1/Native Method)
at java.lang.ref.Reference.processPendingReferences(java.base@11.0.1/Reference.java:241)
at java.lang.ref.Reference$ReferenceHandler.run(java.base@11.0.1/Reference.java:213)
"Finalizer" #3 daemon prio=8 os_prio=0 cpu=0.00ms elapsed=7.95s tid=0x00007f9f901fd800 nid=0x10f in Object.wait() [0x00007f9f65fef000]
java.lang.Thread.State: WAITING (on object monitor)
at java.lang.Object.wait(java.base@11.0.1/Native Method)
- waiting on <0x0000000712108f80> (a java.lang.ref.ReferenceQueue$Lock)
at java.lang.ref.ReferenceQueue.remove(java.base@11.0.1/ReferenceQueue.java:155)
- waiting to re-lock in wait() <0x0000000712108f80> (a java.lang.ref.ReferenceQueue$Lock)
at java.lang.ref.ReferenceQueue.remove(java.base@11.0.1/ReferenceQueue.java:176)
at java.lang.ref.Finalizer$FinalizerThread.run(java.base@11.0.1/Finalizer.java:170)
"Signal Dispatcher" #4 daemon prio=9 os_prio=0 cpu=0.00ms elapsed=7.93s tid=0x00007f9f90210000 nid=0x110 runnable [0x0000000000000000]
java.lang.Thread.State: RUNNABLE
"C2 CompilerThread0" #5 daemon prio=9 os_prio=0 cpu=40.00ms elapsed=7.93s tid=0x00007f9f90212000 nid=0x111 waiting on condition [0x0000000000000000]
java.lang.Thread.State: RUNNABLE
No compile task
"C1 CompilerThread0" #7 daemon prio=9 os_prio=0 cpu=40.00ms elapsed=7.93s tid=0x00007f9f90214000 nid=0x112 waiting on condition [0x0000000000000000]
java.lang.Thread.State: RUNNABLE
No compile task
"Sweeper thread" #8 daemon prio=9 os_prio=0 cpu=10.00ms elapsed=7.93s tid=0x00007f9f90216000 nid=0x113 runnable [0x0000000000000000]
java.lang.Thread.State: RUNNABLE
"Service Thread" #9 daemon prio=9 os_prio=0 cpu=0.00ms elapsed=7.90s tid=0x00007f9f902d3800 nid=0x114 runnable [0x0000000000000000]
java.lang.Thread.State: RUNNABLE
"Common-Cleaner" #10 daemon prio=8 os_prio=0 cpu=0.00ms elapsed=7.89s tid=0x00007f9f902df800 nid=0x116 in Object.wait() [0x00007f9f656ef000]
java.lang.Thread.State: TIMED_WAITING (on object monitor)
at java.lang.Object.wait(java.base@11.0.1/Native Method)
- waiting on <0x0000000712002df0> (a java.lang.ref.ReferenceQueue$Lock)
at java.lang.ref.ReferenceQueue.remove(java.base@11.0.1/ReferenceQueue.java:155)
- waiting to re-lock in wait() <0x0000000712002df0> (a java.lang.ref.ReferenceQueue$Lock)
at jdk.internal.ref.CleanerImpl.run(java.base@11.0.1/CleanerImpl.java:148)
at java.lang.Thread.run(java.base@11.0.1/Thread.java:834)
at jdk.internal.misc.InnocuousThread.run(java.base@11.0.1/InnocuousThread.java:134)
"Attach Listener" #11 daemon prio=9 os_prio=0 cpu=0.00ms elapsed=0.21s tid=0x00007f9f44001000 nid=0x126 waiting on condition [0x0000000000000000]
java.lang.Thread.State: RUNNABLE
"VM Thread" os_prio=0 cpu=0.00ms elapsed=7.95s tid=0x00007f9f901f1000 nid=0x10d runnable
"GC Thread#0" os_prio=0 cpu=0.00ms elapsed=8.01s tid=0x00007f9f90038800 nid=0x108 runnable
"G1 Main Marker" os_prio=0 cpu=0.00ms elapsed=8.00s tid=0x00007f9f90097800 nid=0x109 runnable
"G1 Conc#0" os_prio=0 cpu=0.00ms elapsed=8.00s tid=0x00007f9f90099800 nid=0x10a runnable
"G1 Refine#0" os_prio=0 cpu=0.00ms elapsed=8.00s tid=0x00007f9f9018d000 nid=0x10b runnable
"G1 Young RemSet Sampling" os_prio=0 cpu=0.00ms elapsed=8.00s tid=0x00007f9f9018f000 nid=0x10c runnable
"VM Periodic Task Thread" os_prio=0 cpu=0.00ms elapsed=7.90s tid=0x00007f9f902d6000 nid=0x115 waiting on condition
這nid是操作系統(tǒng)中線程的十六進(jìn)制ID,您可以將其與的輸出匹配pstree。
第一個(gè)命名main的線程是執(zhí)行代碼的線程。
Reference Handler線程負(fù)責(zé)將垃圾收集器發(fā)現(xiàn)的弱引用,軟引用和幻像引用添加到其注冊(cè)的ReferenceQueues中。
Finalizerfinalize準(zhǔn)備運(yùn)行的對(duì)象的線程運(yùn)行方法。
Signal Dispatcher等待特定的操作系統(tǒng)信號(hào)并處理它們。特別是,它使線程轉(zhuǎn)儲(chǔ)上SIGQUIT,還啟動(dòng)對(duì)VM關(guān)機(jī)過(guò)程SIGTERM,SIGINT和SIGHUP。
CompilerThreads 執(zhí)行字節(jié)碼的JIT編譯。
Sweeper thread 清理過(guò)時(shí)的編譯方法。
Service Thread 運(yùn)行一些后臺(tái)JVM任務(wù):檢測(cè)內(nèi)存不足情況,清理StringTable和SymbolTable,發(fā)送延遲的JVMTI事件和GC通知等。
Common-Cleaner運(yùn)行java.lang.ref.Cleaner實(shí)例的清理操作。
Attach Listener線程支持動(dòng)態(tài)附加機(jī)制。它偵聽(tīng)傳入的動(dòng)態(tài)附加連接并執(zhí)行VM命令。例如,它是由使用jstack,jmap與jcmd實(shí)用程序。
VM Thread運(yùn)行需要一個(gè)內(nèi)部VM操作還原點(diǎn)。這樣的操作的示例是反優(yōu)化,類(lèi)重新定義,有偏的鎖吊銷(xiāo),線程轉(zhuǎn)儲(chǔ),堆檢查等。
G1 線程參與垃圾回收。
VM Periodic Task Thread 用于模擬定時(shí)器中斷。
2020-10-18
總結(jié)
以上是生活随笔為你收集整理的java什么时候新建进程_创建名为“ {java}”的线程(即轻量级进程)是为了什么?...的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: java怎么在记事本里写过运行_[置顶]
- 下一篇: java css网页布局实例_java代