When running the necessary commands to gather the diagnostics information you will need the PID of the ColdFusion process along with the service user ColdFusion is running under. You can obtain this information with the following commands.

CF11 and above:

ps aux | grep tomcat

CF9: (CF9 operates on jRun, therefore Tomcat does not play a role on these servers…)

ps aux | grep coldfusion

Lucee:

ps aux | grep cfml

After running one of the above commands you should see an output that contains the service’s PID, uptime, and java arguments. When gathering diagnostics information we’re primarily interested in the service user and PID of the service. Here is a screenshot example of both:

Once you have the PID and service user you’re prepared to collect the necessary information.

Note: The default ColdFusion JRE does not contain the necessary utilities to run the below commands. You will need to be sure there is a JDK on the server that contains JCMD, Jstack, or another similar utility.

Heap Dump:

   1. Navigate to the Java bin directory on the server. Note: You can see the Java directory the service is utilizing in the PS aux output.

   2. Once in the Java bin directory run the following command:

sudo -u cfusion jcmd $PID GC.heap_dump heapdump.hprof

   3. Once the command completes you should see “Heap dump file created” displayed in the Terminal window.

You can also grab a heap dump from the running ColdFusion service utilizing VisualVM if a Remote JMX connection can be established. 

Thread Dump:

  1. Navigate to the Java bin directory on the server. Note: You can see the Java directory the service is utilizing in the PS aux output.
  2. Once in the Java bin directory run the following command:
sudo -u cfusion jstack $PID >> outfile.tdump

You can also grab a thread dump from the running ColdFusion service utilizing VisualVM if a Remote JMX connection can be established. 

After the necessary diagnostics logs have been obtained you zip up the thread dump and heap dump and perform a restart of ColdFusion. 

Did this answer your question?