java.lang.OutOfMemoryError is certainly not a new error in ColdFusion. If you look around the web, you will find many articles. I thought of creating my own steps to be followed, as well as, how to fix the same. This article is based on a Windows platform.
Jcosole is a JMX-compliant graphical tool for monitoring a Java virtual machine. It can monitor both local and remote JVMs. It can also monitor and manage an application.
The jconsole executable can be found in JDK_HOME/bin, where JDK_HOME is the directory in which the Java Development Kit (JDK) is installed. If this directory is in your system path, you can start JConsole by simply typing jconsole in a command (shell) prompt. Otherwise, you have to type the full path to the executable file.
You can use JConsole to monitor both local applications, namely those running on the same system as JConsole, as well as remote applications, namely those running on other systems.
As per our discussion, below are the steps for monitoring the Memory:-
- Stop the ColdFusion service and start ColdFusion from Command prompt. See instructions here.
- Press CTRL+ALT+DELETE, and then click Task Manager.
- In Task Manager, click the Process tab, click View, and then click Select Columns.
- In the Select Columns dialog box, click to select the PID (Process Identifier) check box, and then click OK. You see that the PID column has been added to the Process tab. If not, Enable PID in Task manager: View>Set Column> Check PID
- You can now locate the PID and the corresponding executable file that started the process in Task Manager.
- Start another command prompt and go JDK_HOME/bin and type jconsole pid
- Monitor the graph.
If the non-heap memory is increasing then, the permgen value needs to be recalculated. Whereas, if the heap memory is increasing then the Xmx needs to changed.
These articles are for JRE 7, however, the logic remains the same for JRE 8 as well. If you are on JRE 8, then permgen will be replaced by metaspace. The memory referred to hear is defined in the jvm.config at \ColdFusion11\cfusion\bin\. The same can be changed Server Settings > Java and JVM under ColdFusion Administrator.
Note:- Please take a backup of the jvm.config, before making any changes in the ColdFusion Administrator or the actual file. Changes to JVM would require a ColdFusion service restart.
One of the old ColdFusion article http://www.adobe.com/devnet/coldfusion/articles/coldfusion_performance.html for performance tuning helps in understanding various other parameters related to memory tuning and performance.