You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by St...@asknet.de on 2001/09/06 19:21:11 UTC

optimal SUN JVM config

Hi there the subject of my posting was a bit inacurate ;>(

I know this question is a bit general. but I am very interested in which
Sun Hotspot  jvm options you are using to start up tomcat.
(like -server -Xincgc ...........)
And what impact they had/have on performance.

I am trying to tune garbage collection and performance and am a bit lost
;>)


Any help will be appriciated

take care


stefan




Re: optimal SUN JVM config

Posted by Denis Haskin <De...@HaskinFerguson.net>.
Stefan.Raschke@asknet.de wrote:

> I know this question is a bit general. but I am very interested in which
> Sun Hotspot  jvm options you are using to start up tomcat.
> (like -server -Xincgc ...........)
> And what impact they had/have on performance.
>
> I am trying to tune garbage collection and performance and am a bit lost
> ;>)

Except for -Xms and -Xmx, my recommendation is that twiddling with JVM
command-line parameters should be the *last* thing you try.  (Assuming that
you have access to the source code of your servlet classes, of course.)

I would set -Xmx as high as reasonable for your physical memory
configuration.  And definitely use -server.

Other than that, IMHO you're going to get a *lot* more improvement by
focusing on your code, and many JVM command-line parameters will in fact
hurt performance unless you really know what you're doing.

What problems are you encountering?  Is your servlet just slow, or does it
run out of memory?  If the former, you really need to get one of the
optimizing tools available (several have free evaluation periods) or you can
use -Xrunhprof and crawl through the profiler output yourself (I'm getting
very good at that <grin>).

If it runs out of memory, same approach, actually.  Either a profiling tool
or -Xrunhprof will let you identify where your memory consumption is going.
We have a servlet application that was running out of memory, which we
addressed by using soft references to let the GC reclaim objects that we
were willing to recreate if necessary.

Also, keep in mind Hotspot usually gets better the longer it runs; don't
time the first few requests you make from it...

A colleague actually recently asked about documentation about soft
references and GC in general; this is what I sent him:

<http://www.artima.com/insidejvm/ed2/ch09GarbageCollection01.html> This is
really good.  Skip forward to part 14 and the following parts (although the
whole chapter is pretty good).

<http://developer.java.sun.com/developer/technicalArticles/ALT/RefObj/> Also
pretty good.

Some interesting papers about GC, GC algorithms, HotSpot performance:

<http://java.sun.com/docs/hotspot/gc/index.html>
<http://java.sun.com/docs/hotspot/PerformanceFAQ.html>
<http://java.sun.com/products/hotspot/2.0/docs.html>
<http://developer.java.sun.com/developer/technicalArticles/Networking/HotSpot/>

dwh


More info. RE: forward from servlet to JSP got slow

Posted by Aravind Naidu <ar...@eha.net>.
I have more info. Turned all debug values on in Tomcat and this is the
trace. As one can see there is 5 sec gap between the last 2 lines, and I
have no idea what goes on there.


2001-09-07 21:38:02 - ContextManager: SimpleMapper1: SM: Found extension
mapping
 jsp(org.apache.jasper.servlet.JspServlet/null)
2001-09-07 21:38:02 - ContextManager: SimpleMapper1: SM: After mapping R(  +
/le
on/menu-look1.jsp + null) jsp(org.apache.jasper.servlet.JspServlet/null)
2001-09-07 21:38:02 - ContextManager: After processing: R(  +
/leon/menu-look1.j
sp + null)
2001-09-07 21:38:02 - Ctx(  ): Get real path /leon/menu-look1.jsp
/opt/tomcat/we
bapps/ROOT/leon/menu-look1.jsp /opt/tomcat/webapps/ROOT
2001-09-07 21:38:02 - Ctx(  ): Get real path /leon/menu-look1.jsp
/opt/tomcat/we
bapps/ROOT/leon/menu-look1.jsp /opt/tomcat/webapps/ROOT
2001-09-07 21:38:02 - Ctx(  ): Get real path /leon/menu-look1.jsp
/opt/tomcat/we
bapps/ROOT/leon/menu-look1.jsp /opt/tomcat/webapps/ROOT
2001-09-07 21:38:07 - ContextManager: SimpleRealm: Verify user=null
pass=null


-- Aravind


-----Original Message-----
From: Aravind Naidu [mailto:aravind.naidu@eha.net]
Sent: Friday, 7 September 2001 19:34
To: tomcat-user@jakarta.apache.org
Subject: forward from servlet to JSP got slow


Hi,
Environment is Tomcat 3.2.3 on Linux.

All of a sudden the forward from a servlet to a JSP page got very slow. It
is weird in that we have 2 servers in a load balance pool and it started
happening on 1 server and while debugging it, I stoped and started the other
one and it started happening in the other also.

Any clues ? It eventually gets there but it takes about 15 seconds.

The code is like this.
getServletContext().getRequestDispatcher(nextPage).forward(req, res);


-- Aravind


forward from servlet to JSP got slow

Posted by Aravind Naidu <ar...@eha.net>.
Hi,
Environment is Tomcat 3.2.3 on Linux.

All of a sudden the forward from a servlet to a JSP page got very slow. It
is weird in that we have 2 servers in a load balance pool and it started
happening on 1 server and while debugging it, I stoped and started the other
one and it started happening in the other also.

Any clues ? It eventually gets there but it takes about 15 seconds.

The code is like this.
getServletContext().getRequestDispatcher(nextPage).forward(req, res);


-- Aravind



Re: optimal SUN JVM config

Posted by Bo Xu <bo...@cybershop.ca>.
Stefan.Raschke@asknet.de wrote:

> Hi there the subject of my posting was a bit inacurate ;>(
>
> I know this question is a bit general. but I am very interested in which
> Sun Hotspot  jvm options you are using to start up tomcat.
> (like -server -Xincgc ...........)
> And what impact they had/have on performance.
>
> I am trying to tune garbage collection and performance and am a bit lost
> ;>)
>
> Any help will be appriciated
>
> take care
>
> stefan

good link for you :-)

from:     http://java.sun.com/j2se/1.3/docs/
to:         http://java.sun.com/j2se/1.3/docs/tooldocs/tools.html
to:
            - windows:
http://java.sun.com/j2se/1.3/docs/tooldocs/win32/java.html
            - or:  (solaris/linux) ...


Bo
Sept.06, 2001