You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "c." <ch...@gmail.com> on 2007/12/04 17:41:09 UTC

tomcat.conf JAVA_OPTS

I'm wondering what the JAVA_OPTS -Xminf0.1 and -Xmaxf0.3 are.  Anyone know?

Also, is there a way to start tomcat and have it spit out what JAVA_OPTS
it's using?

Re: [OT] tomcat.conf JAVA_OPTS

Posted by RuiXian BAO <ru...@gmail.com>.
Hello Chuck,

On 12/6/07, Caldarale, Charles R <Ch...@unisys.com> wrote:
>
>
> These date from the first JVMs (more than 10 years ago), when memory was
> expensive, and garbage collection pause time was a function of the size
> of the heap, rather than the number of live objects.  In those days, it
> made sense to try to have your application run with as small a memory
> footprint as possible.  There are still some systems where memory is
> quite limited (e.g., cell phones), but with real servers, it's more
> efficient to set them to the same value.


Thank you for your explanation.

Best

- RuiXian


- Chuck
>
>
> THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
> MATERIAL and is thus for use only by the intended recipient. If you
> received this in error, please contact the sender and delete the e-mail
> and its attachments from all computers.
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

RE: [OT] tomcat.conf JAVA_OPTS

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: RuiXian BAO [mailto:ruixian.bao@gmail.com] 
> Subject: Re: tomcat.conf JAVA_OPTS
> 
> If so, why the -Xms and -Xmx were invented in the first place?

These date from the first JVMs (more than 10 years ago), when memory was
expensive, and garbage collection pause time was a function of the size
of the heap, rather than the number of live objects.  In those days, it
made sense to try to have your application run with as small a memory
footprint as possible.  There are still some systems where memory is
quite limited (e.g., cell phones), but with real servers, it's more
efficient to set them to the same value.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: tomcat.conf JAVA_OPTS

Posted by RuiXian BAO <ru...@gmail.com>.
Hello,

On 12/5/07, Rainer Jung <ra...@kippdata.de> wrote:
>
> Caldarale, Charles R wrote:
> >> From: Rainer Jung [mailto:rainer.jung@kippdata.de]
> >> Subject: Re: tomcat.conf JAVA_OPTS
> >>
> > I'd recommend not setting these unless you really know what's going on
> > inside your heap.  It's usually more beneficial to set -Xms to the same
> > value as -Xmx.
>
> Me to :)


This has  amused me for a long time. If so, why the -Xms and -Xmx were
invented in the first place? Or to make things simpler why not using a
single memory variable just in this situation? Just to cause more confusion
to have two values like current arrangement?:)

Best

- RuiXian


>>> Also, is there a way to start tomcat and have it
> >>> spit out what JAVA_OPTS it's using?
> >
> > Some of the options are processed by the launcher, some by the JVM
> > proper, so there's not any really good way to see them all.  You can set
> > the environment variable _JAVA_LAUNCHER_DEBUG, and it will provide some
> > information about what the launcher is doing and what it's passing on to
> > the JVM.
> >
>
>

Re: tomcat.conf JAVA_OPTS

Posted by Rainer Jung <ra...@kippdata.de>.
Caldarale, Charles R wrote:
>> From: Rainer Jung [mailto:rainer.jung@kippdata.de] 
>> Subject: Re: tomcat.conf JAVA_OPTS
>>
>> c. wrote:
>>> I'm wondering what the JAVA_OPTS -Xminf0.1 and
>>> -Xmaxf0.3 are.  Anyone know?
>> MinHeapFreeRatio and MaxHeapFreeRatio (divided by 100).
> 
> I'd recommend not setting these unless you really know what's going on
> inside your heap.  It's usually more beneficial to set -Xms to the same
> value as -Xmx.

Me to :)

>>> Also, is there a way to start tomcat and have it
>>> spit out what JAVA_OPTS it's using?
> 
> Some of the options are processed by the launcher, some by the JVM
> proper, so there's not any really good way to see them all.  You can set
> the environment variable _JAVA_LAUNCHER_DEBUG, and it will provide some
> information about what the launcher is doing and what it's passing on to
> the JVM.
> 
> Lambda Probe will let you look at System properties, some of which are
> derived from the command line arguments.  (You can also find them in
> JConsole, but it's ugly.)  JConsole will also show the arguments the JVM
> sees under java.lang -> Runtime -> Attributes -> Input Arguments on the
> MBeans tab.

I overlooked this part of the question:

/usr/local/jdk1.6.0/bin/java -XX:+PrintVMOptions -Xmx10m 
-XX:+PrintTenuringDistribution -verbose:gc myTest

produces

VM option '+PrintVMOptions'
VM option '+PrintTenuringDistribution'

...


/usr/local/jdk1.6.0/bin/java -XX:+PrintCommandLineFlags -Xmx10m 
-XX:+PrintTenuringDistribution -verbose:gc myTest

produces

-XX:MaxHeapSize=10485760 -XX:+PrintCommandLineFlags -XX:+PrintGC 
-XX:+PrintTenuringDistribution -XX:+TraceClassUnloading


The first option outputs your original XX switches (only those) as you 
have given them, the other one outputs a semi internal view of how those 
flags have been mapped.

Regards,

Rainer

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: tomcat.conf JAVA_OPTS

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Rainer Jung [mailto:rainer.jung@kippdata.de] 
> Subject: Re: tomcat.conf JAVA_OPTS
> 
> c. wrote:
> > I'm wondering what the JAVA_OPTS -Xminf0.1 and
> > -Xmaxf0.3 are.  Anyone know?
> 
> MinHeapFreeRatio and MaxHeapFreeRatio (divided by 100).

I'd recommend not setting these unless you really know what's going on
inside your heap.  It's usually more beneficial to set -Xms to the same
value as -Xmx.

> > Also, is there a way to start tomcat and have it
> > spit out what JAVA_OPTS it's using?

Some of the options are processed by the launcher, some by the JVM
proper, so there's not any really good way to see them all.  You can set
the environment variable _JAVA_LAUNCHER_DEBUG, and it will provide some
information about what the launcher is doing and what it's passing on to
the JVM.

Lambda Probe will let you look at System properties, some of which are
derived from the command line arguments.  (You can also find them in
JConsole, but it's ugly.)  JConsole will also show the arguments the JVM
sees under java.lang -> Runtime -> Attributes -> Input Arguments on the
MBeans tab.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: tomcat.conf JAVA_OPTS

Posted by Rainer Jung <ra...@kippdata.de>.
c. wrote:
> I'm wondering what the JAVA_OPTS -Xminf0.1 and -Xmaxf0.3 are.  Anyone know?
> 
> Also, is there a way to start tomcat and have it spit out what JAVA_OPTS
> it's using?

MinHeapFreeRatio and MaxHeapFreeRatio (divided by 100). This is used, in 
case you configure your maximum heap size different from the minimum 
heap size. If after GC less than the min percentage of heap is free, 
heap will grow, if more than max percentage is free, heap will shrink.

In your case 10% resp. 30%.

Regards,

Rainer

BTW: that's a general Java question, not Tomcat specific.

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org