JVM Tutorials - Herong's Tutorial Examples - Version 4.23, by Dr. Herong Yang
JRockit Running Out Of Memory Quicker
This section provides a tutorial example on how to test when JRockit JVM runs out of memory by increasing the number of threads with full stacks. JRockit JVM returns OutOfMemoryError exception before reaching 1 GB memory usage lower than HotSpot.
Now let's keep the number of frames with a high number to let the thread to reach the stack overflow point, and increase the number of threads to see when the JRockit JVM will run out of memory.
The results are summarized and listed below together with results from the HotSpot tests: Let's try it:
HotSpot 1.8 JRockit R28 Threads Mem Usage Mem Usage (-Xss1m, 100000 frames) 1 15,008 K 23,476 K 4 18,248 K 32,040 K 16 33,352 K 65,720 K 32 51,336 K 109,460 K 64 84,380 K 280,868 K 128 150,264 K 335,708 K 256 278,684 K 609,460 K 512 541,932 K OutOfMemoryError 1024 1,072,008 K 2048 OutOfMemoryError
As you can see from the output:
When I ran 512 threads with 100000 frames, many threads reached the StackOverflow exception point and the JVM memory usage reached 966,064 K. Then the JVM hang after generating the following exception:
[ERROR][thread ] Could not start thread Thread-428. Not enough storage is available to process this command Stack overflow at 32447 for thread: 437 Exception in thread "Main Thread" java.lang.OutOfMemoryError: Not enough storage is available to process this command in tsStartJavaThread (src/jvm/threads/vmthread/lifecycle.c:1097). Attempting to allocate 1G bytes There is insufficient native memory for the Java Runtime Environment to continue. Possible reasons: The system is out of physical RAM or swap space In 32 bit mode, the process size limit was hit Possible solutions: Reduce memory load on the system Increase physical memory or swap space Check if swap backing store is full Use 64 bit Java on a 64 bit OS Decrease Java heap size (-Xmx/-Xms) Decrease number of Java threads Decrease Java thread stack sizes (-Xss) Disable compressed references (-XXcompressedRefs=false) Stack overflow at 32531 for thread: 438
Looks like JRockit JVM on 32-bit Windows can only support up to 1 GB of memory.
Last update: 2014.
Table of Contents