Since 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

New keys:
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 created a Java library that you can now include in your ColdFusion web application’s WEB-INF\lib directory.

This makes the code much more simple to read and maintain. Here’s an example call to enhance your Server scope.
<cfscript>
runtime = createobject("java", "java.lang.Runtime");
enhancer = createobject("java", "orbwave.ScopeEnhancer");
mgmtFactory = createobject("java", "java.lang.management.ManagementFactory");
sys = createobject("java", "java.lang.System");
memoryPoolBean = mgmtFactory.MemoryPoolMXBeans;
server.jvm = StructNew();
server.jvm.memory = StructNew();
server.jvm.memory.pools = enhancer.memoryPools();
server.jvm.memory.free = runtime.getRuntime().freeMemory();
server.jvm.memory.max = runtime.getRuntime().maxMemory();
server.jvm.arguments = mgmtFactory.RuntimeMXBean.getInputArguments();
server.jvm.threads = enhancer.serverThreads();
server.jvm.properties = enhancer.systemProperties();
server.os.environmentVariables = enhancer.environmentVariables();
</cfscript>
One addition was made in the new library and that is the os.environmentVariables key that holds all of the environment variables of your operating system.

Now all of the information is available for your use.