Ответ зависит от вашей JVM.По моему мнению, неиспользуемая Java-программа приводит к следующим потокам:
2011-04-11 10:25:44
Full thread dump Java HotSpot(TM) 64-Bit Server VM (19.1-b02 mixed mode):
"Attach Listener" daemon prio=10 tid=0x0000000040222000 nid=0x606a waiting on condition [0x0000000000000000]
java.lang.Thread.State: RUNNABLE
Locked ownable synchronizers:
- None
"Low Memory Detector" daemon prio=10 tid=0x0000000040211000 nid=0x6046 runnable [0x0000000000000000]
java.lang.Thread.State: RUNNABLE
Locked ownable synchronizers:
- None
"CompilerThread1" daemon prio=10 tid=0x00007f80d0004000 nid=0x6045 waiting on condition [0x0000000000000000]
java.lang.Thread.State: RUNNABLE
Locked ownable synchronizers:
- None
"CompilerThread0" daemon prio=10 tid=0x00007f80d0001000 nid=0x6044 waiting on condition [0x0000000000000000]
java.lang.Thread.State: RUNNABLE
Locked ownable synchronizers:
- None
"Signal Dispatcher" daemon prio=10 tid=0x000000004020d800 nid=0x6043 runnable [0x0000000000000000]
java.lang.Thread.State: RUNNABLE
Locked ownable synchronizers:
- None
"Finalizer" daemon prio=10 tid=0x00000000401eb000 nid=0x6042 in Object.wait() [0x00007f80d6053000]
java.lang.Thread.State: WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
- waiting on <0x00000000eb561300> (a java.lang.ref.ReferenceQueue$Lock)
at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:118)
- locked <0x00000000eb561300> (a java.lang.ref.ReferenceQueue$Lock)
at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:134)
at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:159)
Locked ownable synchronizers:
- None
"Reference Handler" daemon prio=10 tid=0x00000000401e9000 nid=0x6041 in Object.wait() [0x00007f80d6154000]
java.lang.Thread.State: WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
- waiting on <0x00000000eb5611d8> (a java.lang.ref.Reference$Lock)
at java.lang.Object.wait(Object.java:485)
at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:116)
- locked <0x00000000eb5611d8> (a java.lang.ref.Reference$Lock)
Locked ownable synchronizers:
- None
"main" prio=10 tid=0x0000000040184800 nid=0x603b runnable [0x00007f80db081000]
java.lang.Thread.State: RUNNABLE
at c.main(c.java:1)
Locked ownable synchronizers:
- None
"VM Thread" prio=10 tid=0x00000000401e2000 nid=0x6040 runnable
"GC task thread#0 (ParallelGC)" prio=10 tid=0x0000000040197800 nid=0x603c runnable
"GC task thread#1 (ParallelGC)" prio=10 tid=0x0000000040199800 nid=0x603d runnable
"GC task thread#2 (ParallelGC)" prio=10 tid=0x000000004019b800 nid=0x603e runnable
"GC task thread#3 (ParallelGC)" prio=10 tid=0x000000004019d000 nid=0x603f runnable
"VM Periodic Task Thread" prio=10 tid=0x000000004021c000 nid=0x6047 waiting on condition
Вы можете убедиться сами с jstack -l <pid>
.