Now that the ColdFusion server runs on top of a Java subsystem, I thought it was time for the Server scope to actually contain information about the Java server as well as the CFML processor. The Enhancer adds a new JVM key to the Server scope and adds more keys to the Server.OS structure.

*click image to view full size
Enahncer-781708.jpg

New keys:

  • server.jvm.memory
  • server.jvm.memory.pools
  • server.jvm.threads
  • server.jvm.arguments
  • server.os.CommittedVirtualMemorySize
  • server.os.FreePhysicalMemorySize
  • server.os.FreeSwapSpaceSize
  • server.os.ProcessCpuTime
  • server.os.TotalPhysicalMemorySize
  • server.os.TotalSwapSpaceSize
  • server.os.AvailableProcessors
  • server.os.MBeanInfo

Of course, you can remove any information that you don’t want from the code, but even on my wimpy 500MB RAM/1.33 MHz laptop, execution time for the code was max 67ms and averaged about 32ms.

I made two versions of the code. All of the features descibed above are in the JDK 1.5 version. The 1.4 version still adds some memory values and has the Thread query, but the 1.4 JDK just doesn’t have as many features.

Download Server Scope Enhancer JDK 1.5
Download Server Scope Enhancer JDK 1.4