java.lang.OutOfMemoryError in ColdFusion

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.

http://docs.oracle.com/javase/7/docs/technotes/tools/share/jconsole.html

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.

http://docs.oracle.com/javase/7/docs/technotes/guides/management/jconsole.html

As per our discussion, below are the steps for monitoring the Memory:-

  1. Stop the ColdFusion service and start ColdFusion from Command prompt. See instructions here.
  2. Press CTRL+ALT+DELETE, and then click Task Manager.
  3. In Task Manager, click the Process tab, click View, and then click Select Columns.
  4. 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
  5. You can now locate the PID and the corresponding executable file that started the process in Task Manager.
  6. Start another command prompt and go JDK_HOME/bin and type jconsole pid
  7. 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.

Advertisements

2 thoughts on “java.lang.OutOfMemoryError in ColdFusion

  1. Hi Anit,

    You might like to try JMC Java mission control instead of or as well as jconsole.

    I think it is worth mentioning jconsole and jmc can be useful to see what is happening with the tomcat webserver connector AJP, not just heap, PermSize, CodeCache etc.

    Regards.

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s