Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

Tomcat out of memory
I've a situation where Tomcat is crashing with an out of memory error
every 24-48 hours. I think I may have narrowed down the cause: we have
tens of thousands of jsp pages, and every time one of them is compiled
i see the heap size grow, and it never shrinks back down. Eventually
Tomcat becomes unresponsive, writes out of memory to the catalina log,
and I have to restart it. Here's what I'm running:

RedHat Linux ES 3.0
Apache 2.0.46 with ( mod_jk )
Tomcat 4.1.24
Sun j2sdk 1.4.2_03

My question is, I've explicitly set it in the web.xml configuration so
that Tomcat forks javac processes to another memory partition. Even
so, I'm seeing out of memory reported by Tomcat. Is this a memory leak
in javac, Ant, or is my original hypothesis incorrect?

thanks,
Dale

Report this thread to moderator Post Follow-up to this message
Old Post
Dale
09-27-04 09:02 PM


Re: Tomcat out of memory
On 27 Sep 2004 10:51:00 -0700, Dale <dalelum@gmail.com> wrote:

> I've a situation where Tomcat is crashing with an out of memory error
> every 24-48 hours. I think I may have narrowed down the cause: we have
> tens of thousands of jsp pages, and every time one of them is compiled
> i see the heap size grow, and it never shrinks back down. Eventually
> Tomcat becomes unresponsive, writes out of memory to the catalina log,
> and I have to restart it. Here's what I'm running:
>
> RedHat Linux ES 3.0
> apache 2.0.46 with ( mod_jk )
> Tomcat 4.1.24
> Sun j2sdk 1.4.2_03
>
> My question is, I've explicitly set it in the web.xml configuration so
> that Tomcat forks javac processes to another memory partition. Even
> so, I'm seeing out of memory reported by Tomcat. Is this a memory leak
> in javac, Ant, or is my original hypothesis incorrect?
>
> thanks,
> Dale

Tomcat 5 release notes contain this:
-quote-
--------------------
JAVAC leaking memory:
--------------------

The Java compiler leaks memory each time a class is compiled. Web
applications
containing hundreds of JSP files may as a result trigger out of memory
errors
once a significant number of pages have been accessed. The memory can only
be
freed by stopping Tomcat and then restarting it.

The JSP command line compiler (JSPC) can also be used to precompile the
JSPs.

Note: This issue has been fixed in Sun JDK 1.4.x.
-endquote-


Bill

Report this thread to moderator Post Follow-up to this message
Old Post
William Brogden
09-27-04 09:02 PM


Re: Tomcat out of memory

> Tomcat 5 release notes contain this:
> -quote-
> --------------------
> JAVAC leaking memory:
> --------------------
>
> The Java compiler leaks memory each time a class is compiled. Web
> applications
> containing hundreds of JSP files may as a result trigger out of memory
> errors
> once a significant number of pages have been accessed. The memory can
> only  be
> freed by stopping Tomcat and then restarting it.
>
> The JSP command line compiler (JSPC) can also be used to precompile the
> JSPs.
>
> Note: This issue has been fixed in Sun JDK 1.4.x.
> -endquote-

Yes, I've read that. I am running the 1.4.2 JDK. I've also set javac to
fork. The Tomcat docs have this to say about that:


fork - The internal JVM javac compiler used by Ant has a known memory
leak. And Ant requires that java compiles be synchronized, i.e. only one
JSP page can be compiled at a time. Set fork to true or do not define it
(it is the default value) so that Ant compiles JSP pages in a seperate
JVM. This removes the synchronization of JSP page compiles and prevents
all the javac classes from being instantiated and subsequently garbage
collected by the JVM Tomcat is running in. This also works around known
issues with javac, including memory leaking, as well as JAR file locking
on Windows.


Report this thread to moderator Post Follow-up to this message
Old Post
Dale Lum
09-27-04 09:02 PM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

Java Help archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 05:33 PM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.