Java garbage collection gone horribly wrong

I was at a customer site and saw a java app that was chewing CPU.  Using prstat -L  we saw the busy threads were 2 through 9.  Running pstack $pid/$thread showed that the spinning threads were all running garbage collection.  Luckily verbose GC logging was turned on so we were able to look at the log to see how long the previous full GC cycles lasted:

20493.297: [Full GC [PSYoungGen: 2040K->0K(240064K)] [ParOldGen: 697548K->397070K(1077248K)] 699589K->397070K(1317312K) [PSPermGen: 243883K->243054K(262144K)], 9.3868202 secs]
23490.529: [Full GC [PSYoungGen: 6063K->0K(663616K)] [ParOldGen: 1004912K->588931K(1400832K)] 1010975K->588931K(2064448K) [PSPermGen: 247384K->245927K(262144K)], 613.1687549 secs]
25069.416: [Full GC [PSYoungGen: 660290K->0K(664704K)] [ParOldGen: 961941K->1287172K(1400832K)] 1622231K->1287172K(2065536K) [PSPermGen: 246538K->246128K(262144K)], 14492.5636839 secs]

14492 seconds =  just over 4 hours! Yikes!

3 Responses to “Java garbage collection gone horribly wrong”

  1. pradeep Says:

    Hi

    I got the same problem. If you have any solution, can you please let me know. I am searching
    solution to above problem from last few weeks. its big headache for me resolve this.
    I hope my search will end here.

    Thanks
    Pradeep

  2. William Hathaway Says:

    Hi Pradeep – I’m sorry to say we never got a solution before I had to leave the customer. I did recommend that they try a newer version of the JVM and if that didn’t fix it to try changing garbage collection algorithms.

  3. pradeep Says:

    Thank you William. I will try changing jvm and jvm options too. i hope this will fix my issues.

    Thanks for the same
    Pradeep

Leave a Reply


Copyright © 2010 williamhathaway.com. All Rights Reserved.
No computers were harmed in the 0.431 seconds it took to produce this page.

Designed/Developed by Lloyd Armbrust & hot, fresh, coffee.