2
  • 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
Brad Wood
  • 190

3 Answers3

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

Brad Wood
  • 190
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.

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.

Miguel-F
  • 302
  • 3
  • 11