2. Few Questions to Consider
• What is expected throughput
• What is expected latency
• Maximum No. of concurrent users/tasks
• Expected Throughput/latency at max users
• Worst case latency
• Tolerable GC latency
7. Other OutOfMemory Errors
• Incorrect PermGen size –XXMaxPermSize
– java.lang.OutOfMemoryError: PermGen space
– jstat -gc<pid>
– Can monitory ‘PU’ vs ‘PGCMX’ from jstat -
gccapacity
• Incorrect Direct Buffer limit -
XX:MaxDirectMemorySize
– java.lang.OutOfMemoryError: Direct buffer memory
8. CPU
• Check Garbage collector stats
– Jstat –gc<pid>
• Investigate using – JMX, TOP
– Using TOP get the thread ID
– Thread Dump using ‘kill -3’ or ‘jstack’
– Search Hex thread id in thread dump
9. Disk I/O
• Iostat %iowait<interval><samples>
• High %iowait indicates I/O bottleneck
• If java process is causing high I/O, check the
thread dump
11. Garbage Collector Choice
• Serial GC (Never use this!)
– -XX:+UseSerialGC
• Parallel GC (High Throughput) – Use in non-
interactive jobs which can tolerate pause of 1-
2 sec
– -XX:+UseParallelGC –XX:+UseParallelOldGC
• CMS (Low Latency) – Good for webapps and
interactive processes
– -XX:+UseConcMarkSweepGC