August 11, 2015
Taking Thread Dumps from ColdFusion Server Programmatically
Comments
(2)
August 11, 2015
Taking Thread Dumps from ColdFusion Server Programmatically
(2)

Many times you would want to tweak the performance of the ColdFusion server or want to debug the bottlenecks that make the server unresponsive.

To analyze this, ideally, you would want to have Thread dumps and Server memory snapshots (Heap Space, Eden Space, Survivor Space, Old Gen, Perm Gen).

While you can use JDK tools like jstack to get the dumps, it is tedious to install it and schedule the thread dumps.

So, programmatically thread dumps and memory snapshots are triggered and can be configured as a scheduler task and can be triggered on-demand as well.

Download the following zip file and move it to the server where you want to take thread dumps.

threaddump.zip

This zip file contains two files. One is threaddump.jar file.

Place this file under C:\ColdFusionXX\cfusion\wwwroot\WEB-INF\lib and restart the server for it to load.

And the other file is the cfm file takethreaddump.cfm where the call to ThreadDump class is made and the path where the dump content should be written.

By default it is dumped to the file #GetTempDirectory()#/threaddump<Day>-<Month>-<Year>.log

(Depending on the server location it translates similar to C:\ColdFusionXX\cfusion\runtime\work\Catalina\localhost\tmp\threaddump12-8-2015.log)

You can change this to any other convenient path in the cfm file.

You can call this cfm on-demand at the point in time or configure a new scheduled task to schedule it at some interval.

More number of Thread dumps are more helpful for problem analysis. So, it is better to take at some interval.

On every new day, the dump is rotated automatically to a new file name.

2 Comments
2015-08-17 08:32:28
2015-08-17 08:32:28

Sigh. Fonts are messed up in the article, compared to the surrounding articles.

Like
2015-08-11 10:52:33
2015-08-11 10:52:33

I assume the answer is no, but can this be used with JavaLoader?

Like
Add Comment