tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rommel Sharma" <romms...@cisco.com>
Subject Re: Memory configuration for Tomcat
Date Tue, 04 Feb 2003 05:28:08 GMT
Hi!
 I also was looking for all the possible material to tweak the performance
of Tomcat in terms of Memory Mgmt. Listed down the following after going
through various sites on the net.

Any inputs/suggestions/corrections are welcome...

  1. Are you using Tomcat 4.x for better peformance?
  2. Are you monitoring how long is the garbage collection taking?
  3. Have you made sure that the db connection timeout is set to 10-15
seconds.
     (For the DBCP you set this using the parameter maxWait.)
  4. Are the connections being handled properly? (being closed when not
used, not being closed  twice when a CP is used, etc)
  5. Have you tried using the JVM option "-Xincgc" to use the incremental
garbage collector (See point 7 for more useful options)?

  6. Have you tried decreasing the amount of heap used (in JVM)? A larger
heap will cause garbage  collection pauses to increase because   there is
more heap to scan
     OR
      If you are worried about the number of garbage collections, but less
worried about pause times, have you tried increasing the heap as that
should cause the number of full garbage collections to decrease.


  7. Have you tried using any of the following options(their description
given along) to performance tune your JVM?

  -Xnoclassgc
    Disable class garbage collection.
  -Xincgc
    Enable the incremental garbage collector. The incremental garbage
collector, which is off by default, will eliminate occasional garbage-
collection pauses during program execution. However, it can lead to a
roughly 10% decrease in overall GC performance.
   -Xmsn
    Specify the initial size, in bytes, of the memory allocation pool. This
value must be a multiple of 1024 greater than 1MB. Append the letter k    or
K to indicate kilobytes, or m or M to indicate megabytes. The default value
is 2MB.
         Examples:
           -Xms6291456
           -Xms6144k
           -Xms6m

  -Xmxn
    Specify the maximum size, in bytes, of the memory allocation pool. This
value must a multiple of 1024 greater than 2MB. Append the letter k or K to
indicate kilobytes, or m or M to indicate megabytes. The default value is
64MB. The upper limit for this value will be approximately 4000m on Solaris
7 and Solaris 8 SPARC platforms and 2000m on Solaris 2.6 and x86 platforms,
minus overhead amounts. Examples:
       -Xmx83886080
       -Xmx81920k
       -Xmx80m

-Xssn
Set thread stack size. Each Java thread has two stacks: one for Java code
and one for C code. This option sets the maximum stack size that can be used
by C code in a thread to n. Every thread that is spawned during the
execution of the program passed to java has n as its C stack size. The
default units for n are bytes and n must be > 1000 bytes. To modify the
meaning of n, append either the letter k for kilobytes or the letter m for
megabytes. The default stack size is 512 kilobytes (-Xss512k).
-Xprof
Profiles the running program, and sends profiling data to standard output.
This option is provided as a utility that is useful in program development
and is not intended to be be used in production systems.
-Xrunhprof[:help][:<suboption>=<value>,...]
Enables cpu, heap, or monitor profiling. This option is typically followed
by a list of comma-separated "<suboption>=<value>" pairs. Run the command
java -Xrunhprof:help to obtain a list of suboptions and their default
values.

If answer to any of the questions above is no, then the memory management by
the JVM can definitely be improved by exercising any of the options above.

The 7 questions above are direct pointers to areas to look into when ever
Tomcat users face Memory management problems like
'OutOfMemoryException'.Hope this helps to an extent.

Thanks and regards,
Rommel Sharma.


-----Original Message-----
From: Haytham Samad [mailto:haytham@speakeasy.net]
Sent: Tuesday, February 04, 2003 2:19 AM
To: Tomcat Users List
Subject: Memory configuration for Tomcat


Hi All,

I wanted to tweak the way tomcat (well, JVM in which tomcat runs) uses
memory.
...
...
Thanks,
Haytham
------------------------------------------

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


Mime
View raw message