One of the primary strengths of ColdFusion that, under the hood, it is Java. Your ColdFusion .cfm and .cfc files are compiled to regular Java class files, and your application can natively leverage the vast collection of Java libraries available.
ColdFusion exposes most of the settings for managing the Java Virtual Machine (JVM) in the Administrator. We recommend that you update your JVM configuration directly by editing the jvm.config file in a text editor. We have encountered instances where this GUI does not accurately set the configuration, and it is just as easy to update the config file.
There are some note points which we shall amplify in the performance and scaling best practices section of this guide. The JVM settings after a default install of ColdFusion are typically not adequate for production use. The settings above are what we recommend as a first pass to improve on the default install settings. The optimal configuration for your environment is determined by iterative testing and close attention to logs.
Here we are showing our preferred method of directly editing the jvm.config file.
First, browse to the file location.
The next step is to open it in a text editor. If on Windows be sure to “Run as Administrator”. In this case, we are adding garbage collection (GC) logging.
Configuration settings are set as java.args. It is advisable to preserve your existing settings by prepending a # to the line, and then copying those settings to a new line for editing.
Once the changes have been saved, ColdFusion needs to be restarted.
Tip: As of this writing and under most installations, the highest performance garbage collection rule set is called G1. G1 is not the default for ColdFusion 2018, but it is supported and will be the default in all future releases of CF. Test G1 in an isolated environment under load prior to making any changes to your system.
We have a more in-depth article about tuning the JVM here.
JVM tuning is very application and server specific. It should be done with care and extensive testing before changes are made to your production environment.