tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rommel Sharma" <>
Subject Re: Memory configuration for Tomcat
Date Tue, 04 Feb 2003 05:28:08 GMT
 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
     (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
      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?

    Disable class garbage collection.
    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.
    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.

    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:

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).
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.
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

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 []
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

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message