When trying to judge expected behavior from potentially problematic behavior, looking at memory behavior often is a place ColdFusion Administrators will start.

Even though the standard amount of RAM continues to increase, a close examination of an application's use of system memory remains a critical part of the Q&A process.

Fortunately for the developer, a variety of memory tracking abilities exist to troubleshoot an application's use of system memory. Unfortunately for the developer, the multitude of metrics to choose from increases the chances of making the wrong choice and tracking the incorrect data set.

This article will describe some of the available metrics for tracking memory usage in Microsoft's Windows NT/Windows 2000, Sun Microsystems' Solaris, and Linux.

Windows NT and Windows 2000

When monitoring ColdFusion memory usage in Windows NT or 2000, many developers use the "Mem Usage" statistic in the Task Manager. This statistic measures the working set size. Working set size roughly translates into how much of the ColdFusion process is being kept in RAM. Keep in mind, "Mem Usage" is NOT a measure of overall memory usage.

If overall memory usage needs to be checked periodically, use the "VM Size" column in the Task Manager. To view the "VM Size" column, make sure "Processes" is selected. Click on the "View" menu and choose "Select Columns". A dialog box will appear in which "VM Size" will be an option.

To monitor memory usage and log it over time, Performance Monitor will need to be used. In order to enable Performance Monitor to log memory usage statistics properly, "Pdlcnfig.exe" will need to be executed. Assuming that the system has Microsoft's Resource Kit installed, "Pdlcnfig.exe" will be located in the \WinNT\system32 directory.

This installs the performance logging service and launches the configuration window. To use the counter for ColdFusion memory logging, follow these steps:

  • Select "Process" in the "Performance Object" drop-down box.
  • Select "cfserver" from the "Instances" list.
  • Select "Private Bytes" from the "Performance Counters" list.
  • Click on "Add."

Set the log file name, and select the "Comma Separated Value" (CSV) file format if Excel charting is desired with the data. (CSVs can be opened directly in Excel.) Set the sampling interval (i.e., every 10 minutes) and start the performance logging service by clicking "start" or starting it via the control panel. If you get an error trying to start the service, reboot and try again.

If Windows is doing its job correctly, expect to see Mem Usage rise as ColdFusion runs. This just means more of ColdFusion is being stored in RAM and less is left out on disk while virtual memory is waiting to be paged in.

Remember, "Private Bytes" is the total virtual memory size of the cfserver process and equates to the "VM Size" metric inside Task Manage.

Neither of the statistics provided by the Task Manager or Performance Monitor will show memory being returned. That's because ColdFusion 4.5 incorporates the latest version of SmartHeap, which no longer returns unused memory to NT. Instead, memory is held, assuming ColdFusion may reuse it in the near future. While this method is faster and more efficient, SmartHeap can lead to confusion when looking at memory statistics on NT.

Read More. :- http://kb2.adobe.com/cps/175/tn_17517.html