1
  • ColdFusion 10 Update 10
  • Windows Server 2008 R2
  • Java 1.7.0_21

I am trying to figure Full GCs to run every 10 minutes. I have used the gcInterval JVM arg in the past on earlier versions of ColdFusion with success, but I have confirmed with verbose GC logs that Full GCs are still happening on the hour (Unless the Old Gen gets so full that it forces a full collection).

Here are the full JVM args from ColdFusion10\cfusion\bin\jvm.config (line breaks added for readability)

Is there something else I need to be doing to get this working on ColdFusion 10?

java.args=
-server
-Xms4072m
-Xmx4072m
-XX:PermSize=512m
-XX:MaxPermSize=512m
-Dsun.rmi.dgc.client.gcInterval=600000
-Dsun.rmi.dgc.server.gcInterval=600000
-XX:+UseParallelGC
-XX:+UseParallelOldGC
-Xloggc:gc.log
-verbose:gc
-XX:+PrintGCDetails
-XX:+PrintGCDateStamps
-XX:+PrintGCTimeStamps
-XX:+UseGCLogFileRotation
-XX:NumberOfGCLogFiles=5
-XX:GCLogFileSize=1024K
-Xbatch
-Dcoldfusion.home={application.home}
-Dcoldfusion.rootDir={application.home}
-Dcoldfusion.libPath={application.home}/lib
-Dorg.apache.coyote.USE_CUSTOM_STATUS_MSG_IN_HEADER=true
-Dcoldfusion.jsafe.defaultalgo=FIPS186Random
-Dcoldfusion.classPath={application.home}/lib/updates,{application.home}/lib,{application.home}/lib/axis2,{application.home}/gateway/lib/,{application.home}/wwwroot/WEB-INF/flex/jars,{application.home}/wwwroot/WEB-INF/cfform/jars
2

3 Answers 3

1

For the sake of anyone finding this on Google, here is the answer provided to me by Adobe engineer Rupesh Kumar on the ticket I linked to above.


Brad, in general, the JVM does not run the GC on a fixed regular interval. It is completely up to the JVM to decide when to run the full GC. In case of RMI, since the objects are exported and used by other VM, the garbage collection is distributed and hence the name dgc. Check out the following links to understand what DGC is http://publib.boulder.ibm.com/infocenter/javasdk/v5r0/index.jsp?topic=%2Fcom.ibm.java.doc.diagnostics.50%2Fdiag%2Funderstanding%2Frmi_dgc.html http://java.sys-con.com/node/35865

Because of its nature, DGC needs to have a frequency when GC can run so that the unused objects can get collected. Before JDK 1.6, this default interval was 60 sec and from JDK 1.6 onwards this has been increased to 1 hr by default.

Now coming to why this setting is not working now, by defaulu the RMI server would not be running in Tomcat and therefore DGC is not running. With CF 9, the inbuilt server was JRun which is stack application server that of course would have a RMI server running.

--Rupesh Kumar

1
  • Thanks for the followup, Rupesh. I understand that the JVM likes to make its own determination of when GC is necessary. I have still found that it can be helpful to force GC when tuning apps with certain memory usage patterns. It's too bad there isn't a generic JVM setting for it. For anyone reading this, Fusion Reactor 5 now has a plugin to schedule full GCs if you're interested. I haven't tried it yet, but it does exist.
    – Brad Wood
    Dec 12, 2013 at 11:26
0

1 hour Full Gc's seem to be a feature of either Tomcat of CF10's use of it and yes I too have had issues trying to get timed Full GC's to occur; I find this last item weird as that is a JVM feature not a Tomcat feature, unless it is being suppressed somewhere within Tomcat. I have also, found that the metrics logging setting in CF Admin does not create metrics that are very useful; nothing as they were in JRun.

3
  • Thanks for the reply. When you say you've had issues, does that mean you have gotten it to work in some cases, or you've never gotten it to work with CF10?
    – Brad Wood
    Jun 26, 2013 at 0:47
  • Welcome to Server Fault! If you have another question, please ask it by clicking the Ask Question button.
    – Scott Pack
    Jun 26, 2013 at 1:50
  • I will, but for now I'm still trying to answer the one at the top of this page :)
    – Brad Wood
    Jun 26, 2013 at 3:50
0

Let me start out by saying that I am by no means an expert at garbage collection or JVM configuration for that matter. It is my understanding that you cannot control the garbage collection in the matter that you are attempting. You can "ask" the garbage collector to run at a certain interval but if it, garbage collection, is not necessary then it will not run.

Here are two links that have proven very useful to me:

JVM Memory Management and ColdFusion Log Analysis

Performance Tuning

From the first link above:

The exact time Garbage Collection is run can't be controlled. An application could ask the JVM to run GC, but the JVM will not necessarily run GC when requested but will schedule it at the next opportunity. Normally, applications don't ask the JVM to perform GC. Instead, the JVM is configured to use one of several possible algorithms about how best to perform Garbage Collection. The algorithm is chosen is based on needs of the application and can affect performance in different ways. The goal is to choose an algorithm that works well for your hardware resources and application needs. Ideally for web applications it is desirable to choose an algorithm that produces minimal interruption to the user experience. The one here, -XX:+UseParallelGC, is the default configuration when ColdFusion is installed.

1
  • Thanks for that. I'm aware of the technicalities of requesting a GC etc. Sometimes one can get better performance from an app by suggesting when the collector should run. I typically make these changes after enabling verbose GC collections and analyzing the frequency and duration of minor/major collections while the app is under normal load. Dsun.rmi.dgc.client/server.gcInterval are JVM args documented to control the maximum amount time between major collections. They work as expected on older versions of CF, but are apparently being ignored for me on CF 10.
    – Brad Wood
    Jun 26, 2013 at 20:16

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .