Rob Gonda's Blog

CFMX7 + W2k3 r2 = Access is denied

Back in August I blogged about problems installing ColdFusion in a Windows 2003 box with sp1 pre-installed... the same applies for R2 version. My solution last time was to run the silent install, but there is a much easier one: turn off DEP (Data Execution Prevention), which should work for sp1 and r2.

To do this, right click my computer, goto properties, advanced, top tab: Data Execution Prevention, and switch to the first radio: for essential services only. After that, just reboot and install. It should work flawlessly.

Watch out for memory leaks!

I had a server constantly running out of memory and I just couldn't figure out what was wrong. The first thing I did, thanks to Steven Erat, was enable the jrun metrics to monitor threads, sessions, and jvm memory. You do this by editing the \runtime\servers\coldfusion\SERVER-INF\jrun.xml and set <attribute name="metricsEnabled">true</attribute>. I debugged my caching system, fixed some garbage collection issues, but it still did not completely fixed my problem.
A few days later, I got an insight: the onSessionStart and onSessionEnd functions.

I had the following functions defined:

    <!--- on Session Start --->
    <cffunction name="onSessionStart">
        <cfscript>
            application.com.objectFactory.getInstance('session').addSession(session);
        </cfscript>
    </cffunction>

   
    <!--- on Session End --->
    <cffunction name="onSessionEnd">
        <cfargument name="SessionScope" required="Yes" />
        <cfargument name="ApplicationScope" required="No" />
        <cfscript>
            ApplicationScope.com.objectFactory.getInstance('session').delSession(arguments.SessionScope.sessionId);
        </cfscript>
    </cffunction>


Well, guess what, it seems like even after removing the reference to the specific session, ColdFusion failed to destroy it. I would have assumed that ColdFusion would just destroy the session, and if I happen to still be pointing to it I would get the famous null pointer exception, but no, ColdFusion kept a copy of some sort draining all my memory. As soon as I removed the reference to the session, the jrun garbage collection did its job and memory because stable again.

I will try to look further into this behavior using the Scorpio Server Monitoring, which includes really nice tools to analyze what's using your precious RAM.

This blog is running version 5.9.003. Contact Blog Owner