Skip to main content
June 30, 2009
Question

Garbage Collection Not Firing

  • June 30, 2009
  • 2 replies
  • 1727 views

We are having a bit of time with running out of memory. We have an application used by several hundred people at a time. It's fairly complicated OLTP business logic. We moved from CF 5 to CF 8 last fall. We are currently running 8.0 on a VM, Windows 2003.

The JVM settings were left alone, with the difference that I set maximum memory to 1024, and starting memory to 512.

What seems to happen is the used memory slowly climbs, over the space of an hour or two. On occasion, it will continue to climb until we run out of memory, and the server locks up - we either have to restart coldfusion, or reboot the server.

If I click 'run GC' on the server monitor, memory usage immediately drops down to less than 200 meg. Then it slowly builds up again. I have created a scheduled script that runs every 2 minutes, that checks used memory - if it hits 700 meg, it runs garbage collection. We'll see if this solves the problem long term, but it's still a bandaid, - if the memory is ready to be garbage collect, why is it not going?

Any suggestions would be muich appreciated. Seems different people have this problem for different reasons. I must say, CF5 was extremely stable. CF8 has been a bit more painful.

    This topic has been closed for replies.

    2 replies

    July 10, 2009

    You don't want GC to happen too often.  When GC happens everything stops until GC is done.

    But, you've got to have it happen enough to not run out of space.

    Consider using these two flags in your java.args:

    -XX:+UseConcMarkSweepGC -XX:+UseParNewGC

    Do not use UseConcMarkSweepGC on single processor boxes.

    You could also look at adding the switch to force GC every so often.  Though, I think I read somewhere that was depricated in Java 1.6.

    Finally, consider upgrading to the latest and greatest version of 1.6.  Lots of fixes after 1.6.0_10.

    July 10, 2009

    Thanks for the reply. The problem has evolved - either I did not have the original problem correct, or having my script firing and logging GC has just provided more info. GC only takes a second or so, so it's not a big problem - slow downs are not noticeable.

    We are getting sudden steep memory climbs - it gets over the threshold, GC fires, but it reclaims hardly any memory. Memory continues to rise until the server is unresponsive, and we have to reboot ColdFusion. I'm not sure how to try and isolate what is happening, there's no real good information in the logs, and I don't seem to get much out of the server monitor, either. We are not using CFCs, except in our online text editor - rest is all old CFM from a CF5 installation.

    Any other suggestions would be helpful. I'll look into updating the JVM.

    July 10, 2009

    Rick,

    I forgot to put the obligatory "Get Fusion Reactor" in my last post.  It can be invaluable in tracking down stuff like this.

    It may just come down to your app needing a lot of room to breath.  Options then are pretty much limited to going to 64 bit and opening up the JVM to a LOT of memory.  Our standard JVM heap setting now is 4096/4096.

    July 2, 2009

    An update - my script to run GC is working - but I'm still confused as to why it should be necessary.Ran once at 8 this morning, and at 8:45, it won't be long until it has to do it again.

    Any thoughts, or additional information required, would be greatly appreciated.