Java Mailing List Archive

http://www.junlu.com/

Google
Google
Mailing List
Home
Forum Home
JBoss - Java Application Server
Tomcat - JSP/Servlet container
Struts - A MVC web framework
iText - An open source PDF Java Library
JDOM - JDOM XML Parser
J2EE - A mailing list for Java(tm) 2 Platform, Enterprise Edition
JSP - A mailing list about Java Server Pages specification and reference
J2EE Pattern - An interest list for Sun Java Center J2EE Pattern Catalog
Servlet - A mailing list for discussion about Sun Microsystem's Java Servlet API Technology
Struts & Hibernate
Subjects
JSP editor plugin for eclipse ?
org apache jasper JasperException: Unable to compile class for JSP
Tomcat: Connection reset by peer: socket write error
Cannot retrieve definition for form bean null
Struts Tiles Tutorial (free Struts training)
Where do I download Tomcat 4 0 6?
Data Access Object (DAO) pattern, example DAO 's
Where to download Tomcat v 4 1 24 from?
Tomcat 5 0 16 Requested resource not available
Oracle Connection Pooling in 3 2 2
Servlet : Session invalidate
Servlet action is currently unavailable
Tomcat/Struts Unicode Encoding/Decoding problems
Tomcat and webapplication specific java library path
Running a Simple JMS Example
Mapping in workers2 properties
org apache jasper JasperException
Cannot find message resources under key org apache struts action
   MESSAGE
problem with html:text bean throwing exception
Cannot find message resources under key org apache struts action MESSAGE
invalid direct reference problem with solution
Tool for jsp debug Try Sysdeo Eclipse Plugin
Tomcat 5 Cannot load JDBC driver class 'null ' SQL state: null
weblogic ejbc
java properties file
Jboss 3 2 3 Coyote Can 't re
Tomcat 5, Apache2 and mod jk2 integration problem
JBoss example problem new to J2EE
url string for connecting jboss to oracle
Value attribute of <html:checkbox
javax servlet ServletException: BeanUtils populate
HTTP Status 404 The requested resource is not available
5 0 18: Windows XP Pro vs Windows 2000
 
OutOfMemoryError when jasper (or webappclassloader) tries to read jar files

OutOfMemoryError when jasper (or webappclassloader) tries to read jar files

2006-12-21       - By Renaud Bruyeron

 Back
Reply:     1     2  


We are running into OOM errors that we think are related to this:
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4705373

Our setup:
JDK 1.5.0_08b3 on Debian Linux (2.4.21SMP)
tomcat 5.5.17

We have 3 webapps in the tomcat instance with fairly similar WEB-INF/lib
content
(struts + spring + hibernate, etc) - roughly 25-30MB worth of .jar files.

We have JAVA_OPTS="-server -XX:MaxPermSize=128M
-XX:+HeapDumpOnOutOfMemoryError -Xms$1024m -Xmx1024m" and we are running
on dual-xeon, 4GB main memory hardware.
RAM is never exhausted, we have on average 3GB of free swap, and we
never actually consume all of the non-swap RAM.

This is an example of the top of the stacktraces we experience *after a
while* (i.e. after a couple of days of operation, sometimes more):
java.lang.OutOfMemoryError Source code of java.lang.OutOfMemoryError
      at java.util.zip.ZipFile Source code of java.util.zip.ZipFile(Native Method)
      at java.util.zip.ZipFile Source code of java.util.zip.ZipFile<init>(ZipFile.java:203)
      at java.util.jar.JarFile Source code of java.util.jar.JarFile<init>(JarFile.java:132)
      at java.util.jar.JarFile Source code of java.util.jar.JarFile<init>(JarFile.java:70)
      at sun.net.www.protocol.jar.URLJarFile.<init>(URLJarFile.java:56)
      at
sun.net.www.protocol.jar.URLJarFile.getJarFile(URLJarFile.java:41)
      at
sun.net.www.protocol.jar.JarFileFactory.get(JarFileFactory.java:68)
      at
sun.net.www.protocol.jar.JarURLConnection.connect(JarURLConnection.java:102)

      at
org.apache.jasper.compiler.TagLibraryInfoImpl Source code of org.apache.jasper.compiler.TagLibraryInfoImpl<init>(TagLibraryInfoImpl.java
:175)

      at
org.apache.jasper.compiler.Parser Source code of org.apache.jasper.compiler.Parser(Parser.java:423)
      at org.apache.jasper.compiler.Parser Source code of org.apache.jasper.compiler.Parser(Parser.java:492)
      at org.apache.jasper.compiler.Parser Source code of org.apache.jasper.compiler.Parser(Parser.java:1552)
      at org.apache.jasper.compiler.Parser Source code of org.apache.jasper.compiler.Parser(Parser.java:126)
      at
org.apache.jasper.compiler.ParserController Source code of org.apache.jasper.compiler.ParserController(ParserController.java:211)

      at
org.apache.jasper.compiler.ParserController Source code of org.apache.jasper.compiler.ParserController(ParserController.java:116)

      at
org.apache.jasper.compiler.Parser Source code of org.apache.jasper.compiler.Parser(Parser.java:335)
      at
org.apache.jasper.compiler.Parser Source code of org.apache.jasper.compiler.Parser(Parser.java:372)
      at org.apache.jasper.compiler.Parser Source code of org.apache.jasper.compiler.Parser(Parser.java:484)
      at org.apache.jasper.compiler.Parser Source code of org.apache.jasper.compiler.Parser(Parser.java:1552)
      at org.apache.jasper.compiler.Parser Source code of org.apache.jasper.compiler.Parser(Parser.java:126)
      at
org.apache.jasper.compiler.ParserController Source code of org.apache.jasper.compiler.ParserController(ParserController.java:211)

      at
org.apache.jasper.compiler.ParserController Source code of org.apache.jasper.compiler.ParserController(ParserController.java:116)

      at
org.apache.jasper.compiler.Parser Source code of org.apache.jasper.compiler.Parser(Parser.java:335)
      at
org.apache.jasper.compiler.Parser Source code of org.apache.jasper.compiler.Parser(Parser.java:372)
      at org.apache.jasper.compiler.Parser Source code of org.apache.jasper.compiler.Parser(Parser.java:484)
      at org.apache.jasper.compiler.Parser Source code of org.apache.jasper.compiler.Parser(Parser.java:1552)
      at org.apache.jasper.compiler.Parser Source code of org.apache.jasper.compiler.Parser(Parser.java:126)
      at
org.apache.jasper.compiler.ParserController Source code of org.apache.jasper.compiler.ParserController(ParserController.java:211)

      at
org.apache.jasper.compiler.ParserController Source code of org.apache.jasper.compiler.ParserController(ParserController.java:100)

      at
org.apache.jasper.compiler.Compiler Source code of org.apache.jasper.compiler.Compiler(Compiler.java:155)
      at org.apache.jasper.compiler.Compiler Source code of org.apache.jasper.compiler.Compiler(Compiler.java:295)
      at org.apache.jasper.compiler.Compiler Source code of org.apache.jasper.compiler.Compiler(Compiler.java:276)
      at org.apache.jasper.compiler.Compiler Source code of org.apache.jasper.compiler.Compiler(Compiler.java:264)
      at
org.apache.jasper.JspCompilationContext Source code of org.apache.jasper.JspCompilationContext(JspCompilationContext.java:563)

      at
org.apache.jasper.servlet.JspServletWrapper Source code of org.apache.jasper.servlet.JspServletWrapper(JspServletWrapper.java:303)

      at
org.apache.jasper.servlet.JspServlet Source code of org.apache.jasper.servlet.JspServlet(JspServlet.java:314)
      at org.apache.jasper.servlet.JspServlet Source code of org.apache.jasper.servlet.JspServlet(JspServlet.java:264)
      at javax.servlet.http.HttpServlet Source code of javax.servlet.http.HttpServlet(HttpServlet.java:802)
...

Has anyone else seen this?
The answer is yes, as per
http://mail-archives.apache.org/mod_mbox/tomcat-users/200508.mbox/
%3C20050809123043.6923E10FB2B8@(protected)%3

Note that the user above had a different stacktrace involving the webapp
classloader accessing resources inside jars: we *DO* experience this
kind of stacktrace as well (for example when using javamail APIs, which
tries to open a META-INF/mailcap file), and I think it is the same
underlying problem.

What is the best approach to this problem?
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6280693 suggests that
the underlying JDK bug has been fixed, however this is a JDK6 fix only
at this point.
The original bug
(http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4705373) suggests
that using
ZipInputStream instead of ZipFile would also help.
Please note that our applications do not use the java.util.zip package:
all the exceptions are thrown while inside tomcat (either the
WebappClassLoader or inside jasper).

If anyone has some info on this problem, please let me know

- Renaud

-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ------
To start a new topic, e-mail: users@(protected)
To unsubscribe, e-mail: users-unsubscribe@(protected)
For additional commands, e-mail: users-help@(protected)


©2008 junlu.com - Jax Systems, LLC, U.S.A.