Java Mailing List Archive

http://www.junlu.com/

Google
Google
Mailing List
Home
Forum Home
JBoss - Java Application Server
Struts - A MVC web framework
Tomcat - JSP/Servlet container
iText - An open source PDF Java Library
JDOM - JDOM XML Parser
J2EE - A mailing list for Java(tm) 2 Platform, Enterprise Edition
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
JSP - A mailing list about Java Server Pages specification and reference
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 with Seemingly Plenty of Memory

OutOfMemoryError with Seemingly Plenty of Memory

2004-01-26       - By Dhruva B. Reddy

 Back
Reply:     1     2     3     4     5     6     7  

I am troubleshooting an issue we've been having with Tomcat 4.1.27.  We
have several websites on one instance, and it regularly throws an
OutOfMemoryError, requiring a restart of Tomcat.

Some observations (warning--this is a bit long):

* The box runs two 2.8GHz Pentium 4 Hyperthreaded Xeons, and has 2GB of
RAM (recently upgraded from 1GB).
* The OutOfMemoryError never contains a message (I believe an
OutOfMemoryError is thrown with a message when the java process has
used the maximum number of threads).
* There is a single instance of Tomcat, housing 20 applications
(including the ones that come with the standard distribution of Tomcat,
examples, tomcat-docs, etc.--these apps see no traffic).
* We have a servlet that is hit every five minutes.  It calls
Runtime.freeMemory(), Runtime.totalMemory() and Runtime.maxMemory(),
after calling Runtime.gc(). This information is graphed (free, total -
free, both vs. time).  According to this graph, there is always plenty
of memory available (I have seen the amount of free memory get quite
low--below 1MB, but never when the problem occurs).
* We're running Tomcat 4.1.27, Redhat Linux 7.3, Sun JDK 1.4.1_05.
* Peak traffic is between 10:00 and 22:00 everyday.  The heaviest day
is Monday and the lightest Saturday.
* Together, the applications service an average of 1600+ requests per
hour.
* Before the memory upgrade, we were running an initial heap size of
100MB, and max of 768MB.  We are now running an initial heap size of
768MB and max of 1536MB.
* Uptime used to be about 100 hours, but recently has fallen to 24
hours.  This change does not coincide with any configuration change.  I
have not determined if there is a coincident change in traffic
patterns.  The memory upgrade has had no effect on uptime.
* Before the memory upgrade, when the problem occurred I would find the
java process spinning (i.e., processor use according to top was 99%),
and it appeared to be using some swap space.  Since the memory upgrade,
no swap space has been used, and the spinning has not been observed.
* At the time that the problem occurs, top reports that java is using
500-600MB of RAM.  This has not changed since the memory upgrade.
* Tomcat is set up not to refresh the context automatically.  Although
it is set up to refresh JSPs, we do not do this.  No changes are ever
made without restarting Tomcat.
* We have the JSP compiler set up to fork (i.e., use another instance
of the JVM).
* The problem almost always occurs during hours of heavy use, although
it has also been observed on Saturdays (the day of lightest use).
* Diskspace use is nowhere near capacity.
* For a few days, we ran Tomcat with verbose garbage collection (the
"verbose:gc" flag).  The problem seemed to occur just after a "full"
garbage collection.

Although the possibility of a memory leak (sorry--unintended object
retention) has not been completely ruled out (yes, I'm running the
applications through a profiler), I'm quite puzzled that this problem
would occur when, by all indications, memory use is nowhere near the
limit.

Any insights or other things to look at would be greatly appreciated.

Thanks,
Dhruva


__ ____ ____ ____ ____ ____ ______
Do you Yahoo!?
Yahoo! SiteBuilder - Free web site building tool. Try it!
http://webhosting.yahoo.com/ps/sb/

-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ------
To unsubscribe, e-mail: tomcat-user-unsubscribe@(protected)
For additional commands, e-mail: tomcat-user-help@(protected)




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