I'm running an application server which uses quite a bit of memory (there are quite a few users). It's running on an 18 GB EC2 instance.
I pass these GC parameters to the VM:
-server -XX:GCTimeRatio=19 -Xmx12g -XX:+PrintGCDetails -XX:+PrintGCTimeStamps
The server works fine for awhile (as well as you'd expecte without concurrent GC) but after a few days, it suddenly grew the heap by a huge amount, and took us into swap which destroyed the server performance and required a restart:
217408.525: [Full GC [PSYoungGen: 12935K->0K(530944K)] [PSOldGen: 5668446K->4551217K(5431168K)] 5681382K->4551217K(5962112K) [PSPermGen: 50534K->50480K(50816K)], 11.8155060 secs] [Times: user=9.73 sys=2.08, real=11.81 secs]
217963.521: [Full GC [PSYoungGen: 13247K->0K(635776K)] [PSOldGen: 5422640K->4884067K(5741120K)] 5435887K->4884067K(6376896K) [PSPermGen: 50489K->50489K(50816K)], 8.4219030 secs] [Times: user=8.38 sys=0.05, real=8.43 secs]
218452.573: [Full GC [PSYoungGen: 20879K->0K(877504K)] [PSOldGen: 5720236K->4873397K(5788544K)] 5741115K->4873397K(6666048K) [PSPermGen: 50502K->50502K(50816K)], 10.9450630 secs] [Times: user=9.13 sys=1.84, real=10.95 secs]
219061.305: [Full GC [PSYoungGen: 73587K->0K(4073600K)] [PSOldGen: 5790501K->5022476K(6031040K)] 5864088K->5022476K(10104640K) [PSPermGen: 50518K->50518K(50816K)], 11.1695740 secs] [Times: user=8.80 sys=1.81, real=11.17 secs]
That last line seems very much out of step. Why would the PS young gen heap suddenly grow to 4 GB?
Running this VM on Ubuntu:
java version "1.6.0_20"
Java(TM) SE Runtime Environment (build 1.6.0_20-b02)
Java HotSpot(TM) 64-Bit Server VM (build 16.3-b01, mixed mode)
EDIT: Happened a second time tonight.
101017.205: [Full GC [PSYoungGen: 73185K->0K(4095616K)] [PSOldGen: 6373373K->5318013K(6638016K)] 6446559K->5318013K(10733632K) [PSPermGen: 46183K->46183K(46272K)], 221.1337460 secs] [Times: user=8.13 sys=1.26, real=221.08 secs]
EDIT: Here is a graph of the last 3 hours on our production server.