Title:
Exception in onApplicationStart causes a leak of org.hibernate.impl.SessionFact¬ory.Impl
| View in TrackerStatus/Resolution/Reason: Closed/Fixed/
Reporter/Name(from Bugbase): david ames / david ames (david ames)
Created: 07/08/2012
Components: Performance
Versions: 9.0.1
Failure Type: Memory Leak
Found In Build/Fixed In Build: 9.0.1 /
Priority/Frequency: Major / Some users will encounter
Locale/System: English / Win 2008 Server x64
Vote Count: 5
Problem Description:
If there is an exception in the onApplicationStart event in application.cfc, every time the application attempts to load, 1 instance of org.hibernate.impl.SessionFact¬ory.Impl is created and never cleaned up. IE, a classic memory leak.
This means that on a server with multiple applications, 1 application can crash the entire server.
Steps to Reproduce:
Create a new application based on the following:
<cfcomponent>
<cfscript>
this.name = 'MemoryLeak';
this.ormenabled = true;
this.dataSource = 'SomeDataSource';
this.ormsettings.cfclocation = expandPath("model");
this.ormsettings.eventhandling=true;
this.ormSettings.flushatrequestend = false;
this.ormSettings.automanagesession = true;
</cfscript>
<cffunction name="onApplicationStart" access="public" returntype="boolean" output="false">
<cfthrow message="This will cause a memory leak" />
</cffunction>
</cfcomponent>
Point a copy of Apache JMeter at it, use JVisualVM to keep an eye on the heap - you will see that the number of instances of org.hibernate.impl.SessionFact¬ory.Impl climbs rapidly, eventually crashing the server.
Actual Result:
Server crash with GC Overhead limit exceeded.
Expected Result:
Server should not crash.
Any Workarounds:
----------------------------- Additional Watson Details -----------------------------
Watson Bug ID: 3263093
External Customer Info:
External Company:
External Customer Name: davidames
External Customer Email:
External Test Config: My Hardware and Environment details:
Attachments:
Comments: