Search code examples
garbage-collectionjvmheap-memory

JVM Major Garbage Collections Not Running for months


My application garbage collector used to run a major frequently, maybe once a day. But it stopped working suddenly. Now it has reached to 90 % and I had to restart the application few times. This is in a production environment and what I allowed to do is read the logs and see the JVM states via provided UI.

Another observation I made was for the last 3 months, 1st 2 months there was no minor garbage collections but a lot of majors. For the last month no major collections but many minor collections.


Solution

  • Perhaps it never does a major collection because you are restarting the application before it gets a chance.

    You should be getting many minor collections if the young space is a reasonable size.

    If you were only getting major collections most likely your JVM wasn't tuned correctly. I would try to remove as many GC tuning parameters as possible and only add each one if you know it helps. Having too many tuning parameters set is a good way to get strange behaviour.