Trying CMS Garbage Collection

I was previously trying the parallel throughput collector (-XX:+UseParallelGC) with ergonomics, but every description I've ever read of this collector says it's appropriate for lots of RAM, and numerous processors. I've observed relatively good performance in my little 192M Xen VPS.

The CMS collector (-XX:+UseConcMarkSweepGC) sounds a bit more appropriate for my small setup, so I'm testing that now. I decided to drop the incremental mode (-XX:+CMSIncrementalMode), since it felt like the incremental collection of the tenured area may have been causing thrashing of the swap space on the machine. It seems that no matter what I do, this Java process always needs lots of memory -- heap is limited to 40M, permanent space is limited to 50M, and thread stack is only 96K, but the server still takes up 320M+ of virtual memory.

Here are my current settings:

-server -Xms40m -Xmx40m -XX:MaxPermSize=50M -XX:NewRatio=5 -XX:ThreadStackSize=96 -Xss96k -XX:+UseBiasedLocking -XX:+UseConcMarkSweepGC -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -verbose:gc -XX:-TraceClassUnloading

I don't think the NewRatio is actually having affect though, since the DefNew sizes in the GC logs stay the same.

Filed Under: Web-Dev Computers Blog-Code Linux Java