You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by BruceLee <ml...@yahoo.com> on 2008/10/02 06:15:14 UTC

Seek help for javax.servlet.ServletException: Java heap space

Dear Team, 

I tried hard for this heap space issue for several days. Also searched this
forum but couldn't find the proper answer. 

On my hosting server, I got this error after I viewed 2 or 3 pages. My main
page is always OK though. 
I tried JAVA_OPTS -Xms128m -Xmx512m -Xss1024k -XX:MaxPermSize=128m. It it
didn't help. 
On my local machine, everything is fine without any JAVA_OPTS customization. 

Attached the stack trace oom.txt. The hosting server tomcat 5.5.25 with
cPanel. 
I use Appfuse 1.9.4 (Spring2.0, WebWork2.2.4)

Any ideas are really appreciated! 
-Bruce 
http://www.nabble.com/file/p19773103/oom.txt oom.txt 

-------Error on page------
??

javax.servlet.ServletException: Java heap space
	at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:273)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
	at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
	at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
	at
org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:691)
	at
org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:469)
	at
org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:403)
	at
org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:301)
	at
com.opensymphony.webwork.dispatcher.ServletDispatcherResult.doExecute(ServletDispatcherResult.java:114)
	at
com.opensymphony.webwork.dispatcher.WebWorkResultSupport.execute(WebWorkResultSupport.java:143)
	at
com.opensymphony.xwork.DefaultActionInvocation.executeResult(DefaultActionInvocation.java:311)
	at
com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:206)
	at
com.opensymphony.xwork.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:168)
	at
com.opensymphony.xwork.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86)
	at
com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:188)
	at
com.opensymphony.xwork.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:88)
	at
com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:188)
	at
com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:31)
	at
com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:188)
	at
com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:31)
	at
com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:188)
	at
com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:31)
	at
com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:188)
	at
com.opensymphony.webwork.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:171)
	at
com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:188)
	at
com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:31)
	at
com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:188)
	at
com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:31)
	at
com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:188)
	at
com.opensymphony.xwork.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:151)
	at
com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:188)
	at
com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:31)
	at
com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:188)
	at
com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:31)
	at
com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:188)
	at
com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:31)
	at
com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:188)
	at
com.opensymphony.xwork.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:186)
	at
com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:188)
	at
com.opensymphony.xwork.DefaultActionProxy.execute(DefaultActionProxy.java:113)
	at
com.opensymphony.webwork.dispatcher.DispatcherUtils.serviceAction(DispatcherUtils.java:225)
	at
com.opensymphony.webwork.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:202)
	at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
	at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
	at
com.opensymphony.module.sitemesh.filter.PageFilter.parsePage(PageFilter.java:118)
	at
com.opensymphony.module.sitemesh.filter.PageFilter.doFilter(PageFilter.java:52)
	at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
	at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
	at
org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:375)
	at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
	at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
	at com.cmn.webapp.filter.GZIPFilter.doFilterInternal(GZIPFilter.java:41)
	at
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:77)
	at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
	at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
	at
org.displaytag.filter.ResponseOverrideFilter.doFilter(ResponseOverrideFilter.java:125)
	at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
	at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
	at
com.cmn.webapp.filter.LocaleFilter.doFilterInternal(LocaleFilter.java:55)
	at
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:77)
	at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
	at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
	at
com.opensymphony.clickstream.ClickstreamFilter.doFilter(ClickstreamFilter.java:42)
	at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
	at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
	at
org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:174)
	at
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:77)
	at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
	at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
	at
org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:264)
	at
org.acegisecurity.intercept.web.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:107)
	at
org.acegisecurity.intercept.web.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:72)
	at
org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
	at
org.acegisecurity.ui.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:110)
	at
org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
	at
org.acegisecurity.providers.anonymous.AnonymousProcessingFilter.doFilter(AnonymousProcessingFilter.java:125)
	at
org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
	at
org.acegisecurity.ui.rememberme.RememberMeProcessingFilter.doFilter(RememberMeProcessingFilter.java:142)
	at
org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
	at
org.acegisecurity.wrapper.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:81)
	at
org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
	at
org.acegisecurity.ui.AbstractProcessingFilter.doFilter(AbstractProcessingFilter.java:217)
	at
org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
	at org.acegisecurity.ui.logout.LogoutFilter.doFilter(LogoutFilter.java:108)
	at
org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
	at
org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:193)
	at
org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
	at
org.acegisecurity.util.FilterChainProxy.doFilter(FilterChainProxy.java:148)
	at
org.acegisecurity.util.FilterToBeanProxy.doFilter(FilterToBeanProxy.java:98)
	at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
	at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
	at
org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:78)
	at
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:77)
	at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
	at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
	at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
	at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)
	at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
	at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
	at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
	at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151)
	at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:200)
	at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:283)
	at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:773)
	at
org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:703)
	at
org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:895)
	at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
	at java.lang.Thread.run(Thread.java:619)


-- 
View this message in context: http://www.nabble.com/Seek-help-for-javax.servlet.ServletException%3A-Java-heap-space-tp19773103p19773103.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: Seek help for javax.servlet.ServletException: Java heap space

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Choudhury@labware.com [mailto:Choudhury@labware.com]
> Subject: RE: Seek help for javax.servlet.ServletException:
> Java heap space
>
> Why is it usually better to set -Xms and -Xmx to the
> same value ?

It avoids the overhead of expansion and contraction of the heap, including the associated bookkeeping.  In this age of inexpensive RAM, there's no point in trying to be conservative.

> Also there are some weird problems in running tomcat 6.0.18
> with Jconsole remotely .

Only due to firewalls blocking the secondary JMX port.  You can run JConsole locally on the target machine and tunnel the output to your display if using Linux.  (For Windows, use Terminal Services to run JConsole locally.)  There's some overhead incurred on the target machine, but when analyzing heap issues that's not a problem.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: Seek help for javax.servlet.ServletException: Java heap space

Posted by Ch...@labware.com.
Hi Chuck,
                   Why is it  usually better to set -Xms and -Xmx to the 
same value ? Can you please explain a little bit of this . Also there are 
some weird problems in running tomcat 6.0.18 with Jconsole remotely . It 
keeps giving me "Connection refused error" . Mark did mention about the 
new LifeCycleListener that we can expect to have out of the box in 6.0.19 
which is supposed to make life easy with using Jconsole but still then I 
don't have any clue to what I can do get going with Jconsole remotely .Any 
ideas ?BTW this is the thread that I am talking about here ..

http://www.mail-archive.com/users@tomcat.apache.org/msg51208.html

Regards,

Subhrajyoti 
Mobile: +919830079545
Mail: choudhury@labware.com
Web: www.labware.com

LabWare LIMS Solutions - Results Count



"Caldarale, Charles R" <Ch...@unisys.com> 
10/02/2008 10:02 AM
Please respond to
"Tomcat Users List" <us...@tomcat.apache.org>


To
Tomcat Users List <us...@tomcat.apache.org>
cc

Subject
RE: Seek help for javax.servlet.ServletException: Java heap space






> From: BruceLee [mailto:mli321@yahoo.com]
> Subject: Seek help for javax.servlet.ServletException: Java heap space
>
> I tried JAVA_OPTS -Xms128m -Xmx512m -Xss1024k -XX:MaxPermSize=128m.
> On my local machine, everything is fine without any JAVA_OPTS
> customization.

What JVM are you using on your hosting server?

What JVM are you using on your local machine?

1) Read this:
http://wiki.apache.org/tomcat/FAQ/Memory

2) Use JConsole to see what's really going on in the Tomcat heap on your 
hosting server while it's running.

3) If JConsole access isn't permitted, turn on -verbose:gc to get an idea 
of what's happening with the heap.

4) Turn on -XX:+HeapDumpOnOutOfMemoryError and use jhat to see what's 
consuming the space.  Look here for info on jhat:
http://java.sun.com/javase/6/docs/technotes/tools/share/jhat.html

5) The -Xss value seems rather high; you normally don't have to play with 
this.

6) It's usually better to set -Xms and -Xmx to the same value to avoid 
heap thrashing.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY 
MATERIAL and is thus for use only by the intended recipient. If you 
received this in error, please contact the sender and delete the e-mail 
and its attachments from all computers.

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org



RE: Seek help for javax.servlet.ServletException: Java heap space

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: BruceLee [mailto:mli321@yahoo.com]
> Subject: Seek help for javax.servlet.ServletException: Java heap space
>
> I tried JAVA_OPTS -Xms128m -Xmx512m -Xss1024k -XX:MaxPermSize=128m.
> On my local machine, everything is fine without any JAVA_OPTS
> customization.

What JVM are you using on your hosting server?

What JVM are you using on your local machine?

1) Read this:
http://wiki.apache.org/tomcat/FAQ/Memory

2) Use JConsole to see what's really going on in the Tomcat heap on your hosting server while it's running.

3) If JConsole access isn't permitted, turn on -verbose:gc to get an idea of what's happening with the heap.

4) Turn on -XX:+HeapDumpOnOutOfMemoryError and use jhat to see what's consuming the space.  Look here for info on jhat:
http://java.sun.com/javase/6/docs/technotes/tools/share/jhat.html

5) The -Xss value seems rather high; you normally don't have to play with this.

6) It's usually better to set -Xms and -Xmx to the same value to avoid heap thrashing.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org