You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Wendy Smoak <ja...@wendysmoak.com> on 2005/05/11 19:42:43 UTC

Memory for JSP Compliation in 4.1

Will adding
   JAVA_OPTS=-Xmx128M
to catalina.sh help with running out of memory during JSP compilation in
4.1?

The notes in catalina.sh say that these options will be used when the
"start" "stop" or "run" command is executed, but from the Jasper config
page, I see that Tomcat will 'fork' another JVM in order to compile JSPs.
Does this new JVM "inherit" the memory settings of the original, or is there
some other way to increase its memory?

I'm reading here:

http://jakarta.apache.org/tomcat/tomcat-4.1-doc/jasper-howto.html#Configuration
and another mailing list thread about the same thing, though I can't tell if
it was ever resolved
   http://www.mail-archive.com/tomcat-user@jakarta.apache.org/msg144736.html

Yet AGAIN, something that works fine on my Windows development box is
failing when I move it to the production web server which is running HP-UX.


Thank you,
Wendy Smoak


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: Memory for JSP Compliation in 4.1

Posted by Wendy Smoak <ja...@wendysmoak.com>.
From: "Will Hartung" <wi...@msoft.com>
> Um...how big is the JSP that you're compiling? Is there perhaps a way to
> make it smaller? Perhaps including some of the static content at runtime
> rather than compile? (I'm trying to fathom a big enough JSP that would
blow
> up the compiler, but who knows.)

Each JSP is tiny, and they get assembled at runtime by Tiles in a Struts
app.  I'm looking in the 'work' directory on my Win2K development box (on
which this webapp works _fine_) and none of the .java files is over 100K.

It's only when I put the .war file on the production HP-UX server that I
have a problem.  So it's probably just another quirk of HP's JVM.  It
wouldn't be the first.  The current machine is on 1.4.2 still, so I'm going
to cross my fingers that it goes away with the 1.5 JVM.

Thanks for confirming my suspicion that -Xmx isn't going to help if it forks
a new JVM.  (And there's nowhere to specify how much memory for the forked
JVM??)

Any opinion on my turning fork to false and starting Tomcat with
JAVA_OPTS=-Xmx512M ?  (Knowing that there might be a memory leak and it may
need to be restarted occasionally.)  Is that considered "a lot" of memory
for Tomcat?  Too much?  (The machine has 4G.)  I need to limp along for
another couple of weeks until our scheduled maintenance outage time.

Thanks,
Wendy Smoak


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: Memory for JSP Compliation in 4.1

Posted by Will Hartung <wi...@msoft.com>.
> From: "Wendy Smoak" <ja...@wendysmoak.com>
> Sent: Wednesday, May 11, 2005 10:42 AM
Subject: Memory for JSP Compliation in 4.1


> Will adding
>    JAVA_OPTS=-Xmx128M
> to catalina.sh help with running out of memory during JSP compilation in
> 4.1?
>
> The notes in catalina.sh say that these options will be used when the
> "start" "stop" or "run" command is executed, but from the Jasper config
> page, I see that Tomcat will 'fork' another JVM in order to compile JSPs.
> Does this new JVM "inherit" the memory settings of the original, or is
there
> some other way to increase its memory?

First off, no, the -Xmx option will do nothing in terms of affecting the
memory for a JSP compile if fork is true.

If fork is false, then the -Xmx options that you ran your original Tomcat
with WILL affect the heap size for the compiler, but that assumes the Sun
compiler. I don't know if HP's JVM is using Suns compiler or not (it may
be). See, the Sun compiler is just a java class that can run like any other
class. But if HPs JVM doesn't have the Sun compiler class available, then
the JSP compiler is simply going to call javac, and that's going to fork no
matter what your Jasper setting.

Also note that at some point in the 4.1 version, the JSP/Sun compiler combo
had a memory leak. I don't know if that was Tomcat, Jasper, or Suns compiler
that was at fault, or whether your version has it fixed, but that was an
early impetus for forking to compile JSPs in the first place, to punt around
the memory leak.

Um...how big is the JSP that you're compiling? Is there perhaps a way to
make it smaller? Perhaps including some of the static content at runtime
rather than compile? (I'm trying to fathom a big enough JSP that would blow
up the compiler, but who knows.)

Have you considered looking at precompiling the JSPs (or at least the few
nasty ones that are grenading your server)? Then you'd perhaps have more
control over memory for the compile that the standard Jasper engine doesn't
expose to you.

Regards,

Will Hartung
(willh@msoft.com)




---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org