10. OutOfMemoryError
Exception in thread "main": java.lang.OutOfMemoryError:
Java heap space
Exception in thread "main": java.lang.OutOfMemoryError:
PermGen space
Exception in thread "main": java.lang.OutOfMemoryError:
GC overhead limit exceeded
Exception in thread "main": java.lang.OutOfMemoryError:
Unable to create new native thread
and more...
Friday, October 4, 13
18. OOM - PermGen
This occurs when JVM wants to load new class
definitions; but there is not enough space in
PermGen space
Friday, October 4, 13
19. OOM - PermGen
Symptom
At server startup
Cause
Bigger PermGen footprint
Resolution
Increase PermGen capacity -XX:MaxPermSize
Friday, October 4, 13
20. OOM - PermGen
Symptom
PermGen space increases gradually
Cause
Possible classloader leak
Resolution
Investigate any third party API you are using
for any potential class loader leak defect
Friday, October 4, 13
21. OOM - PermGen
Symptom
OOM after deploy-redeploy cycles
Cause
Possible classloader leak in the App Server
Resolution
Someone should fix it for you. Hmm..where is
EAP?
Friday, October 4, 13
23. OOM - GC overhead
limit exceeded
Policy to allow the VM to detect potential
OutOfMemoryError conditions earlier and before
it runs out of Java Heap space.
Can be turned off -XX:-UseGCOverheadLimit
But don’t!
Friday, October 4, 13
24. OOM - GC overhead
limit exceeded
When is this error triggered?
✓Too
✓Too
Friday, October 4, 13
many Full GC iterations
much time spent in GC
26. OOM - Unable to create
new native thread
JVM is asking a new thread from the OS and
the underlying OS cannot allocate a new
thread anymore.
Friday, October 4, 13
28. OOM - Unable to create
new native thread
✓ Check ulimit - process limit
✓ Consider using thread-pools
✓ Reduce heap space or perform
Friday, October 4, 13
vertical scaling
55. Class Histogram
jmap -F -histo `pgrep java`
Make it a practice to proactively use this
command after a load test and endurance test.
Friday, October 4, 13