OutOfMemoryError

Hi all,

About every 2nd or 3rd request [when using fwreinit=1], we're seeing a
java.lang.OutOfMemoryError.

We're using Adobe CF 8.1 on JRun, and ColdBox 3.0.0.beta1

Is it just plain silly to be doing an fwreinit=1 on every request
whilst in dev mode?

Any advice is really appreciated.

Please see stack trace below (apologies for the size!):

javax.servlet.ServletException: ROOT CAUSE:
coldfusion.runtime.EventHandlerException: Event handler exception.
        at coldfusion.runtime.AppEventInvoker.onRequestStart
(AppEventInvoker.java:229)
        at coldfusion.filter.ApplicationFilter.invoke
(ApplicationFilter.java:264)
        at coldfusion.filter.RequestMonitorFilter.invoke
(RequestMonitorFilter.java:48)
        at coldfusion.filter.MonitoringFilter.invoke
(MonitoringFilter.java:40)
        at coldfusion.filter.PathFilter.invoke(PathFilter.java:86)
        at coldfusion.filter.LicenseFilter.invoke(LicenseFilter.java:
27)
        at coldfusion.filter.ExceptionFilter.invoke
(ExceptionFilter.java:70)
        at coldfusion.filter.ClientScopePersistenceFilter.invoke
(ClientScopePersistenceFilter.java:28)
        at coldfusion.filter.BrowserFilter.invoke(BrowserFilter.java:
38)
        at coldfusion.filter.NoCacheFilter.invoke(NoCacheFilter.java:
46)
        at coldfusion.filter.GlobalsFilter.invoke(GlobalsFilter.java:
38)
        at coldfusion.filter.DatasourceFilter.invoke
(DatasourceFilter.java:22)
        at coldfusion.CfmServlet.service(CfmServlet.java:175)
        at coldfusion.bootstrap.BootstrapServlet.service
(BootstrapServlet.java:89)
        at jrun.servlet.FilterChain.doFilter(FilterChain.java:86)
        at coldfusion.monitor.event.MonitoringServletFilter.doFilter
(MonitoringServletFilter.java:42)
        at coldfusion.bootstrap.BootstrapFilter.doFilter
(BootstrapFilter.java:46)
        at jrun.servlet.FilterChain.doFilter(FilterChain.java:94)
        at jrun.servlet.FilterChain.service(FilterChain.java:101)
        at jrun.servlet.ServletInvoker.invoke(ServletInvoker.java:106)
        at jrun.servlet.JRunInvokerChain.invokeNext
(JRunInvokerChain.java:42)
        at jrun.servlet.JRunRequestDispatcher.invoke
(JRunRequestDispatcher.java:286)
        at jrun.servlet.ServletEngineService.dispatch
(ServletEngineService.java:543)
        at jrun.servlet.jrpp.JRunProxyService.invokeRunnable
(JRunProxyService.java:203)
        at jrunx.scheduler.ThreadPool$ThreadThrottle.invokeRunnable
(ThreadPool.java:428)
        at jrunx.scheduler.WorkerThread.run(WorkerThread.java:66)
Caused by: java.lang.OutOfMemoryError: PermGen space
        at coldfusion.tagext.lang.InvokeTag.doEndTag(InvokeTag.java:
447)
        at cfController2ecfc1280163407$funcRUNEVENT.runFunction(C:
\Codebase\enigma\common\frameworks\coldbox\coldbox_3.0.0.Beta1\system
\Controller.cfc:506)
        at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:418)
        at coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke
(UDFMethod.java:360)
        at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke
(UDFMethod.java:324)
        at coldfusion.filter.FunctionAccessFilter.invoke
(FunctionAccessFilter.java:56)
        at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:
277)
        at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:192)
        at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:
448)
        at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:
308)
        at coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:2260)
        at
cfColdbox2ecfc1113563672$funcPROCESSCOLDBOXREQUEST.runFunction(C:
\Codebase\enigma\common\frameworks\coldbox\coldbox_3.0.0.Beta1\system
\Coldbox.cfc:175)
        at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:418)
        at coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke
(UDFMethod.java:360)
        at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke
(UDFMethod.java:324)
        at coldfusion.filter.FunctionAccessFilter.invoke
(FunctionAccessFilter.java:56)
        at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:
277)
        at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:192)
        at coldfusion.runtime.CfJspPage._invokeUDF(CfJspPage.java:
2464)
        at cfApplication2ecfc436617897$funcONREQUESTSTART.runFunction
(C:\Codebase\enigma\version2.1\sites
\sharedmaternity.cmdhb.predict.co.nz\Application.cfc:53)
        at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:418)
        at coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke
(UDFMethod.java:360)
        at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke
(UDFMethod.java:324)
        at coldfusion.filter.FunctionAccessFilter.invoke
(FunctionAccessFilter.java:56)
        at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:
277)
        at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:192)
        at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:
448)
        at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:
308)
        at coldfusion.runtime.AppEventInvoker.invoke
(AppEventInvoker.java:74)
        at coldfusion.runtime.AppEventInvoker.onRequestStart
(AppEventInvoker.java:221)
        ... 25 more

        at coldfusion.monitor.event.MonitoringServletFilter.doFilter
(MonitoringServletFilter.java:70)
        at coldfusion.bootstrap.BootstrapFilter.doFilter
(BootstrapFilter.java:46)
        at jrun.servlet.FilterChain.doFilter(FilterChain.java:94)
        at jrun.servlet.FilterChain.service(FilterChain.java:101)
        at jrun.servlet.ServletInvoker.invoke(ServletInvoker.java:106)
        at jrun.servlet.JRunInvokerChain.invokeNext
(JRunInvokerChain.java:42)
        at jrun.servlet.JRunRequestDispatcher.invoke
(JRunRequestDispatcher.java:286)
        at jrun.servlet.ServletEngineService.dispatch
(ServletEngineService.java:543)
        at jrun.servlet.jrpp.JRunProxyService.invokeRunnable
(JRunProxyService.java:203)
        at jrunx.scheduler.ThreadPool$ThreadThrottle.invokeRunnable
(ThreadPool.java:428)
        at jrunx.scheduler.WorkerThread.run(WorkerThread.java:66)

how much memory have you got assigned to CF ?

z

IT might be your jvm configuration does not have enough memory assigned to it. There is no way this will happen for a single app, unless you are doing something naughty.

Luis

Just to point out that its a PermGen Space issue, not a heap overflow.

Are you doing anything with Javaloader, and if so, are you storing it the server scope?

Mark

Thanks for all the responses.

According to JRun Management Console:
Max Heap: 512MB
Only other args passed to JVM: -Xms32m -Dsun.io.useCanonCaches=false

I should mention we’re using ColdSpring for IoC.

In our onRequestStart, we do this:
// context object
if(isDefined(“rc.fwreinit”) or not getColdboxOCM().lookup(“context”)) {

getColdboxOCM().set(“context”, getPlugin(“ioc”).getBean(‘context’));
}

See attached for ColdSpring config.

So, the idea with this is - to give us access to all our “Beans” which are setup by ColdSpring through a single “context” object.

However, I suspect [but cant confirm] that the weight of this context object is quite big - and possibly the cause of the OutOfMemoryError.

Is what we’re doing here with ColdSpring dodgey?

We’re also setting a handful of other CFCs into the ColdBox OCM - but they’re pretty lite weight.

[with attachment]

Thanks for all the responses.

According to JRun Management Console:
Max Heap: 512MB
Only other args passed to JVM: -Xms32m -Dsun.io.useCanonCaches=false

I should mention we’re using ColdSpring for IoC.

In our onRequestStart, we do this:
// context object
if(isDefined(“rc.fwreinit”) or not getColdboxOCM().lookup("
context")) {
getColdboxOCM().set(“context”, getPlugin(“ioc”).getBean(‘context’));
}

See attached for ColdSpring config.

So, the idea with this is - to give us access to all our “Beans” which are setup by ColdSpring through a single “context” object.

However, I suspect [but cant confirm] that the weight of this context object is quite big - and possibly the cause of the OutOfMemoryError.

Is what we’re doing here with ColdSpring dodgey?

We’re also setting a handful of other CFCs into the ColdBox OCM - but they’re pretty lite weight.

coldspring.xml (6.12 KB)