JVM Tutorials - Herong's Tutorial Examples - v5.13, by Herong Yang
Thread Test on HotSpot 1.6
This section provides a tutorial example to see how many running threads can be supported on HotSpot 1.6.0_02 Client and Server JVMs.
After installing JDK 6u2, I tested the CrashThread.java program again on a Windows XP system. Here are the results.
Both HotSpot Client and HotSpot Server 1.6.0_02 have no problem with 16 threads.
With 32 threads running, HotSpot Client 1.6.0_02 took 99% of the CPU time according to the report from Windows Task Manager. The system was not jammed. But it became sluggish.
With 32 threads running, HotSpot Server 1.6.0_02 also took 99% of the CPU time according to the report from Windows Task Manager. But the system response time was much better that HotSpot client test.
With 128 threads running under HotSpot Client 1.6.0_02. The system became very sluggish. But I was able to launch other applications.
With 128 threads running under HotSpot Server 1.6.0_02. The system became sluggish. But everything is working fine.
With 512 threads running under HotSpot Server 1.6.0_02. The system became very sluggish. But the system was not totally frozen. I was still able to use a text editor to types these notes.
Obviously, there has been a major thread management improvement of JDK 1.6.0 on a Windows XP system over JDK 1.4.0 on a Windows 2000 system.
Another interesting observation was that JDK 1.6.0 took some time (about 5 minutes) to launch all 512 threads, see the timestamps recorded below. May be extra time was spend on requesting more memory from the Windows system.
10:24:08 PM Launched thread 1 10:24:08 PM Launched thread 2 10:24:08 PM Launched thread 3 10:24:08 PM Launched thread 4 ... 10:28:59 PM Launched thread 508 10:28:59 PM Launched thread 509 10:28:59 PM Launched thread 510 10:28:59 PM Launched thread 511 10:28:59 PM Launched thread 512
Table of Contents
JVM (Java Virtual Machine) Specification
Java HotSpot VM - JVM by Oracle/Sun
java.lang.Runtime Class - The JVM Instance
java.lang.System Class - The Operating System
ClassLoader Class - Class Loaders
Class Class - Class Reflections
JVM Stack, Frame and Stack Overflow
►Thread Testing Program and Result
CrashThread2.java - Thread Testing Program
Thread Test on HotSpot 1.4 and JRockit 7.0
CPU Impact of Multi-Thread Applications
I/O Impact of Multi-Thread Applications
Micro Benchmark Runner and JVM Options
Micro Benchmark Tests on "int" Operations
Micro Benchmark Tests on "long" Operations
Micro Benchmark Tests in JIT Compilation Mode
Micro Benchmark Tests on "float" and "double" Operations