JVM Tutorials - Herong's Tutorial Examples
∟Garbage Collection Tests
∟GC Test - Client vs. Server
This section provides a tutorial example on testing garbage collection by comparing performances between HotSpot Server VM and HotSpot Client VM.
I also made some tests to compare between the client version and the server version of JDK 1.4.0.
java -server -Xms2m -Xmx8m GCTest 16 24 > tail_16_24.out
But the program ran out of memory the same way as the client version:
Time Total Free Free Total Act. Dead Over sec. Mem. Mem. Per. Obj. Obj. Obj. Head 0 1984 1726 86% 0 0 0 258 0 1984 1593 80% 128 128 0 263 1 1984 1463 73% 256 256 0 265 .... 19 5260 357 6% 4736 4736 0 167 19 5260 227 4% 4864 4864 0 169 20 8128 2997 36% 4992 4992 0 139 20 8128 2867 35% 5120 5120 0 141 21 8128 2866 35% 5120 4992 128 142 21 8128 2864 35% 5120 4864 256 144 .... 41 8128 482 5% 7424 4352 3072 222 42 8128 352 4% 7552 4480 3072 224 42 8128 223 2% 7680 4608 3072 225 Exception in thread "main" java.lang.OutOfMemoryError
Last update: 2003.
Table of Contents
About This Book
Download and Install Java SE 1.6 Update 2
java.lang.Runtime Class - The JVM Instance
java.lang.System Class - The Operating System
ClassLoader Class - Class Loaders
Class Class - Class Reflections
Sun's JVM - Java HotSpot VM
JRockit JVM 7.0 by BEA Systems
JRockit JVM 8.0 by BEA Systems
Memory Management Rules and Tests
►Garbage Collection Tests
GCTest.java - Garbage Collection Test Program
GC Test - Constant Memory Requirement
GC Test - Periodical Memory Requirement
GC Test - Releasing Old vs. New Objects
GC Test - JDK 1.4.0 vs. JDK 1.3.1
►GC Test - Client vs. Server
GC Test - JDK 1.6.0 vs. JDK 1.4.0
Stack Overflow Tests
Thread Testing Program and Result
StringBuffer Testing Program and Result
CDS (Class Data Sharing)
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
References
PDF Printing Version