Highlighted

Cold Fusion11 issue with not being available and Java heap size

Explorer ,
May 26, 2015

Copy link to clipboard

Copied

Hi,

Currently running Cold Fusion 11 on a 32 bit Windows 2008 server.

At times receiving the message on the screen "The service is unavailable"

Restarted the ColdFuison 11 Application Server service and the application came back.

I  looked in the coldfusion-error.log file and found the following message:

Caused by: java.lang.OutOfMemoryError: Java heap space

] with root cause

javax.servlet.ServletException: ROOT CAUSE:

coldfusion.runtime.EventHandlerException: Event handler exception.

at coldfusion.runtime.AppEventInvoker.onRequest(AppEventInvoker.java:309)

at coldfusion.filter.ApplicationFilter.invoke(ApplicationFilter.java:462)

at coldfusion.filter.RequestMonitorFilter.invoke(RequestMonitorFilter.java:42)

at coldfusion.filter.MonitoringFilter.invoke(MonitoringFilter.java:40)

at coldfusion.filter.PathFilter.invoke(PathFilter.java:142)

at coldfusion.filter.ExceptionFilter.invoke(ExceptionFilter.java:94)

at coldfusion.filter.ClientScopePersistenceFilter.invoke(ClientScopePersistenceFilter.java:28)

at coldfusion.filter.BrowserFilter.invoke(BrowserFilter.java:38)

at coldfusion.filter.NoCacheFilter.invoke(NoCacheFilter.java:58)

at coldfusion.filter.GlobalsFilter.invoke(GlobalsFilter.java:38)

at coldfusion.filter.DatasourceFilter.invoke(DatasourceFilter.java:22)

at coldfusion.filter.CachingFilter.invoke(CachingFilter.java:62)

at coldfusion.CfmServlet.service(CfmServlet.java:219)

at coldfusion.bootstrap.BootstrapServlet.service(BootstrapServlet.java:89)

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)

at coldfusion.monitor.event.MonitoringServletFilter.doFilter(MonitoringServletFilter.java:42)

at coldfusion.bootstrap.BootstrapFilter.doFilter(BootstrapFilter.java:46)

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)

at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)

at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)

at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:501)

at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)

at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)

at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)

at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:422)

at org.apache.coyote.ajp.AjpProcessor.process(AjpProcessor.java:199)

at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:607)

at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:314)

at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)

at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)

at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)

at java.lang.Thread.run(Thread.java:745)

Caused by: java.lang.OutOfMemoryError: Java heap space

I found the following in the jvm.config file:

java.args=-server -Xms256m -Xmx512m -XX:MaxMetaspaceSize=192m -XX:+UseParallelGC -Xbatch -Dcoldfusion.home={application.home} -Djava.awt.headless=true -Duser.language=en -Dcoldfusion.rootDir={application.home} -Djava.security.policy={application.home}/lib/coldfusion.policy -Djava.security.auth.policy={application.home}/lib/neo_jaas.policy  -Dcoldfusion.classPath={application.home}/lib/updates,{application.home}/lib,{application.home}/lib/axis2,{application.home}/gateway/lib/,{application.home}/wwwroot/WEB-INF/cfform/jars,{application.home}/wwwroot/WEB-INF/flex/jars,{application.home}/lib/oosdk/lib,{application.home}/lib/oosdk/classes -Dcoldfusion.libPath={application.home}/lib -Dorg.apache.coyote.USE_CUSTOM_STATUS_MSG_IN_HEADER=true -Dcoldfusion.jsafe.defaultalgo=FIPS186Random -Dorg.eclipse.jetty.util.log.class=org.eclipse.jetty.util.log.JavaUtilLog

Per research, the memory size should be increased. What should the values be?

Mike

Views

766

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

Cold Fusion11 issue with not being available and Java heap size

Explorer ,
May 26, 2015

Copy link to clipboard

Copied

Hi,

Currently running Cold Fusion 11 on a 32 bit Windows 2008 server.

At times receiving the message on the screen "The service is unavailable"

Restarted the ColdFuison 11 Application Server service and the application came back.

I  looked in the coldfusion-error.log file and found the following message:

Caused by: java.lang.OutOfMemoryError: Java heap space

] with root cause

javax.servlet.ServletException: ROOT CAUSE:

coldfusion.runtime.EventHandlerException: Event handler exception.

at coldfusion.runtime.AppEventInvoker.onRequest(AppEventInvoker.java:309)

at coldfusion.filter.ApplicationFilter.invoke(ApplicationFilter.java:462)

at coldfusion.filter.RequestMonitorFilter.invoke(RequestMonitorFilter.java:42)

at coldfusion.filter.MonitoringFilter.invoke(MonitoringFilter.java:40)

at coldfusion.filter.PathFilter.invoke(PathFilter.java:142)

at coldfusion.filter.ExceptionFilter.invoke(ExceptionFilter.java:94)

at coldfusion.filter.ClientScopePersistenceFilter.invoke(ClientScopePersistenceFilter.java:28)

at coldfusion.filter.BrowserFilter.invoke(BrowserFilter.java:38)

at coldfusion.filter.NoCacheFilter.invoke(NoCacheFilter.java:58)

at coldfusion.filter.GlobalsFilter.invoke(GlobalsFilter.java:38)

at coldfusion.filter.DatasourceFilter.invoke(DatasourceFilter.java:22)

at coldfusion.filter.CachingFilter.invoke(CachingFilter.java:62)

at coldfusion.CfmServlet.service(CfmServlet.java:219)

at coldfusion.bootstrap.BootstrapServlet.service(BootstrapServlet.java:89)

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)

at coldfusion.monitor.event.MonitoringServletFilter.doFilter(MonitoringServletFilter.java:42)

at coldfusion.bootstrap.BootstrapFilter.doFilter(BootstrapFilter.java:46)

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)

at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)

at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)

at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:501)

at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)

at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)

at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)

at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:422)

at org.apache.coyote.ajp.AjpProcessor.process(AjpProcessor.java:199)

at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:607)

at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:314)

at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)

at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)

at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)

at java.lang.Thread.run(Thread.java:745)

Caused by: java.lang.OutOfMemoryError: Java heap space

I found the following in the jvm.config file:

java.args=-server -Xms256m -Xmx512m -XX:MaxMetaspaceSize=192m -XX:+UseParallelGC -Xbatch -Dcoldfusion.home={application.home} -Djava.awt.headless=true -Duser.language=en -Dcoldfusion.rootDir={application.home} -Djava.security.policy={application.home}/lib/coldfusion.policy -Djava.security.auth.policy={application.home}/lib/neo_jaas.policy  -Dcoldfusion.classPath={application.home}/lib/updates,{application.home}/lib,{application.home}/lib/axis2,{application.home}/gateway/lib/,{application.home}/wwwroot/WEB-INF/cfform/jars,{application.home}/wwwroot/WEB-INF/flex/jars,{application.home}/lib/oosdk/lib,{application.home}/lib/oosdk/classes -Dcoldfusion.libPath={application.home}/lib -Dorg.apache.coyote.USE_CUSTOM_STATUS_MSG_IN_HEADER=true -Dcoldfusion.jsafe.defaultalgo=FIPS186Random -Dorg.eclipse.jetty.util.log.class=org.eclipse.jetty.util.log.JavaUtilLog

Per research, the memory size should be increased. What should the values be?

Mike

Views

767

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
May 26, 2015 0
Guide ,
May 26, 2015

Copy link to clipboard

Copied

Hi Mike,

CF Java 32 bit so there is 1.2 to 1.4 Gb of memory that can be used. The error message says Java heap space so perhaps alter Xmx512m to Xmx1024m. Restart CF to apply that change. You could do well to make a copy of JVM.CONFIG by way of backup before applying change.

There are other strategies to apply like setting Xms to the same as Xmx as well as configuring a setting for new generation which is part of heap with Xmn however I think worry more about fine tuning once the outages are resolved.

HTH, Carl.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
May 26, 2015 0
Community Beginner ,
May 26, 2015

Copy link to clipboard

Copied

Tip: Enter or change the  attribute -XX:MaxPermSize = 196m. I use as well. Usually this type of error occurs in the GC that does not have the CF application data running. The @carltype3 the tip is good and we also recommend you to set the JVM the way he suggested because it can be your App and the way it was developed is consuming more memory than the GC releases. It is also good to study a little about tactics of configs JVM because we can set up for better optimization of your application.

Thank you!

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
May 26, 2015 0
Guide ,
May 26, 2015

Copy link to clipboard

Copied

Dear Eduardo,

Initially reading what you said does sound helpful. More care needs to be taken. You mention applying XX:MaxPermSize = 196m. PermSize is a Java 7 and earlier parameter. Adding that to what I think is CF11 Java 8 parameters is a syntax error. Fortunately with Java 8 it is a syntax error that does not stop the world.

Why do I think CF11 Java 8?  The "CF11 with update 3 installer" applied Duser.language=en to JVM arguments and XX:MaxMetaspaceSize=192m is present, Metaspace being a Java 8 parameter.

Modifying your reasonable suggestion then is to alter to this JVM setting:-XX:MaxMetaspaceSize=196m

HTH again, Carl.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
May 26, 2015 0
Guide ,
May 26, 2015

Copy link to clipboard

Copied

Since amount of memory is limited on 32 bit compared to 64 bit I wonder how much memory space is being consumed by CodeCache and CompressedClassSpace?

Regards, Carl.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
May 26, 2015 0
Guide ,
May 27, 2015

Copy link to clipboard

Copied

Here is an example of memory use of a 32 bit CF11 running Java 8 with no JVM arguments applied for CodeCache which is typically the case. Notice CodeCache is consuming 24Mb of possible 240Mb. Perhaps one can do well to define a smaller maximum setting for CodeCache to leave more free memory for Heap and Metaspace. What value well would depend how much you know CodeCache is likely to consume. In the example pictured perhaps a maximum of 64Mb will suffice for the type of work load -XX:ReservedCodeCacheSize=64m

Capture.PNG

HTH again, Carl.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
May 27, 2015 0
Guide ,
Jun 03, 2015

Copy link to clipboard

Copied

Hi Mike,

This idea could be of assistance.

CF11 installer lays down Java version 1.8.0_25

Running this java command out to a file:

CF11\jre\bin\>java  -XX:+PrintFlagsFinal  -version  >  file.txt

Reading "file.txt" partly says:

MinHeapFreeRatio=0 MaxHeapFreeRatio=100

I think those settings above are going to lead to memory pressure as the heap will fill then hopefully try full garbage collect but might not be able to collect due to full heap. So to manage that better start CF with these settings added:

-XX:MinHeapFreeRatio=40 -XX:MaxHeapFreeRatio=70

Note you should do you own testing to know what particular values to use.

Regards, Carl.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jun 03, 2015 0