Re: Java heap size limit

2010-02-11 Thread Peter Crowther
On 11 February 2010 15:29, Caldarale, Charles R
 wrote:
>> From: Peter Crowther
>> 3) Most insidiously, if the system's loaded or allocated something
>> that it can't move in the middle of your process' address space, it
>> may be unable to move that.
>
> Doesn't happen.  The JVM reserves the maximum heap space, but doesn't commit 
> or otherwise touch it until needed.  Nothing else can be allocated in the 
> reserved space.  Regardless, once an item (e.g., DLL) is loaded in a 
> particular process space, it won't be moved (it might be removed, but not 
> relocated).

That's good to know.  My "deep" knowledge of process memory allocation
is still stuck in the dark ages, with the old-style UNIX brk(2); at
least the modern OSs are better than that!

- Peter

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



RE: Java heap size limit

2010-02-11 Thread Caldarale, Charles R
> From: peter.crowth...@googlemail.com
> [mailto:peter.crowth...@googlemail.com] On Behalf Of Peter Crowther
> Subject: Re: Java heap size limit
> 
> 1) CPU time to expand the heap - during which your application may be
> unresponsive, I'm not sure how the modern JVMs work.

Expansion is done by a separate thread, but the app may still be stuck waiting 
for the expansion in order to satisfy a large allocation.  For typical 
allocations, the expansion is asynchronous.

> 2) The system may have overcommitted memory in the meantime, so may
> need time to flush other data or programs to disk - again, your
> application may be unresponsive during this time.

This is true any time significant swapping occurs.

> 3) Most insidiously, if the system's loaded or allocated something
> that it can't move in the middle of your process' address space, it
> may be unable to move that.

Doesn't happen.  The JVM reserves the maximum heap space, but doesn't commit or 
otherwise touch it until needed.  Nothing else can be allocated in the reserved 
space.  Regardless, once an item (e.g., DLL) is loaded in a particular process 
space, it won't be moved (it might be removed, but not relocated).

 - 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 unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Java heap size limit

2010-02-11 Thread Peter Crowther
On 11 February 2010 14:56, Jeffrey Janner  wrote:
> Also, as I've heard several times here, set the -Xms and -Xmx settings to the 
> same to improve garbage collect efficiency. (did I interpret that correctly?)

Allocation efficiency - and to make sure you actually get the memory
when you need it!

If you allocate a small heap initially, then need to expand it later,
you have the following potential problems:
1) CPU time to expand the heap - during which your application may be
unresponsive, I'm not sure how the modern JVMs work.
2) The system may have overcommitted memory in the meantime, so may
need time to flush other data or programs to disk - again, your
application may be unresponsive during this time.
3) Most insidiously, if the system's loaded or allocated something
that it can't move in the middle of your process' address space, it
may be unable to move that.  In this case, you won't be able to expand
the heap at all - even though there's plenty of free memory in the
machine, and you could have had the extra space if you'd asked for it
to start with.

That's my understanding, anway.  Chuck, should I have put my fireproof
suit on before posting this? :-)

- Peter

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



RE: Java heap size limit

2010-02-11 Thread Jeffrey Janner
>From: Caldarale, Charles R [mailto:chuck.caldar...@unisys.com] 
>Sent: Thursday, February 11, 2010 7:37 AM
>
>> From: Hadole, Nishant IN BOM SISL [mailto:nishant.had...@siemens.com]
>> Subject: RE: Java heap size limit
>> 
>> For 32 bit system, maximum memory pool can easily increased upto 2 GB.
>
>Not likely.  The most you can set the heap to on 32-bit Windows is around 1.5 
>GB; the actual value varies a great deal >depending on the versions of the 
>various components and the whims of Windows on a particular day.

I've managed to squeeze ~1.7GB out of the system by setting the /3G boot 
switch, but you want to be careful about that in your environment. That switch 
does have its own drawbacks.
Also, as I've heard several times here, set the -Xms and -Xmx settings to the 
same to improve garbage collect efficiency. (did I interpret that correctly?)

And as Chris says elsewhere, if you goal is to use a much larger portion of 
that 32Gb main, then you will have to go to a 64-bit OS version.  Since you'll 
have to re-install everything, you should go ahead and get the Tomcat 5.5.28 
installer so that it deploys the correct service wrapper.  You'll also need to 
go get the 64-bit version of the JVM you are using.

Jeff

***  NOTICE  *
This message is intended for the use of the individual or entity to which 
it is addressed and may contain information that is privileged, 
confidential, and exempt from disclosure under applicable law.  If the 
reader of this message is not the intended recipient or the employee or 
agent responsible for delivering this message to the intended recipient, 
you are hereby notified that any dissemination, distribution, or copying 
of this communication is strictly prohibited.  If you have received this 
communication in error, please notify us immediately by reply or by 
telephone (call us collect at 512-343-9100) and immediately delete this 
message and all its attachments.


Re: Java heap size limit

2010-02-11 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Yoav,

On 2/11/2010 9:44 AM, Yoav Lanenter wrote:
> Thanks Chris
> 
> For now I can't change my machine to 32bit
> Will I be able increase to 2G of java on 32 bit machine ?

If you are running *NIX, you might be able to squeeze-out another couple
of MiB, but you're essentially going to be trapped in the 1.5-2.5GiB
heap space in a 32-bit environment.

Another option is to run multiple JVMs, but that quickly suffers from
diminishing returns.

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkt0GjAACgkQ9CaO5/Lv0PBGHwCfXwIrOoMnQWhGUxeh1i9vmUAd
nZMAnR6CmTgj8nuSJl6PYWIjMPRBtIHm
=kX7C
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



RE: Java heap size limit

2010-02-11 Thread Caldarale, Charles R
> From: Yoav Lanenter [mailto:yo...@consist.co.il]
> Subject: RE: Java heap size limit
> 
> Will I be able increase to 2G of java on 32 bit machine ?

As we said before, no - unless you're running with the Windows boot option that 
specifies use of a 3 GB user process space.  You'll need to experiment with 
various heap settings until you find the limit *for your environment*.  Again, 
for a 2 GB user process space, the maximum heap is around 1.3 - 1.5 GB.

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



RE: Java heap size limit

2010-02-11 Thread Yoav Lanenter
Thanks Chris

For now I can't change my machine to 32bit
Will I be able increase to 2G of java on 32 bit machine ?

Thanks

Yoav

-Original Message-
From: Christopher Schultz [mailto:ch...@christopherschultz.net] 
Sent: Thursday, February 11, 2010 4:44 PM
To: Tomcat Users List
Subject: Re: Java heap size limit

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Yoav,

On 2/11/2010 1:18 AM, Yoav Lanenter wrote:
> tomcat 5.5,Win Server 2003,32 bit,32 GB RAM
> 
> my question is how can i increase the Java heap size to the maximum
> (maximum memory pool) using the apropicate script\configuration

All the other answers are correct and helpful, but nobody has told you
how you can use all that sweet, sweet memory, yet: switch to a 64-bit
environment, and you can have almost all 32GiB to your JVM.

That means 64-but JVM running on a 64-bit OS. So, basically, you have to
start-over.

Good luck,
- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkt0F8YACgkQ9CaO5/Lv0PA8hwCgkZqKKpqzKdP/fJSczCYZmkZp
MesAoLXbQGIVo0FRSAjzk8T5o9sTXza3
=Hbot
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Java heap size limit

2010-02-11 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Yoav,

On 2/11/2010 1:18 AM, Yoav Lanenter wrote:
> tomcat 5.5,Win Server 2003,32 bit,32 GB RAM
> 
> my question is how can i increase the Java heap size to the maximum
> (maximum memory pool) using the apropicate script\configuration

All the other answers are correct and helpful, but nobody has told you
how you can use all that sweet, sweet memory, yet: switch to a 64-bit
environment, and you can have almost all 32GiB to your JVM.

That means 64-but JVM running on a 64-bit OS. So, basically, you have to
start-over.

Good luck,
- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkt0F8YACgkQ9CaO5/Lv0PA8hwCgkZqKKpqzKdP/fJSczCYZmkZp
MesAoLXbQGIVo0FRSAjzk8T5o9sTXza3
=Hbot
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



RE: Java heap size limit

2010-02-11 Thread Caldarale, Charles R
> From: Hadole, Nishant IN BOM SISL [mailto:nishant.had...@siemens.com]
> Subject: RE: Java heap size limit
> 
> For 32 bit system, maximum memory pool can easily increased upto 2 GB.

Not likely.  The most you can set the heap to on 32-bit Windows is around 1.5 
GB; the actual value varies a great deal depending on the versions of the 
various components and the whims of Windows on a particular day.

> 1. If using batch start-up file
> Add set CATALINA_OPTS=-Xms64M -Xmx128M in catlina.bat

Don't do that - leave catalina.bat alone.  Create a setenv.bat file to hold 
environment settings like CATALINA_OPTS.

> 2. If running as windows service, Using tomcat monitor --> java -->
> initial & maximum memory pool

That one's right.

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



RE: Java heap size limit

2010-02-10 Thread Hadole, Nishant IN BOM SISL
For catlina.bat changes, value for Xms corresponds to initial memory pool & Xmx 
 to maximum memory pool. Set the values accordingly.

With best regards,
Nishant Hadole

-Original Message-
From: Hadole, Nishant IN BOM SISL [mailto:nishant.had...@siemens.com]
Sent: Thursday, 11 February, 2010 11:57 AM
To: 'Tomcat Users List'
Cc: 'yo...@consist.co.il'
Subject: RE: Java heap size limit

For 32 bit system, maximum memory pool can easily increased upto 2 GB.

1. If using batch start-up file
Add set CATALINA_OPTS=-Xms64M -Xmx128M in catlina.bat

2. If running as windows service, Using tomcat monitor --> java --> initial & 
maximum memory pool

With best regards,
Nishant Hadole
Siemens IT Solutions and Services
-Original Message-
From: Yoav Lanenter [mailto:yo...@consist.co.il]
Sent: Thursday, 11 February, 2010 11:48 AM
To: users@tomcat.apache.org
Subject: Java heap size limit




Hi,

my configuration is:

tomcat 5.5,Win Server 2003,32 bit,32 GB RAM

my question is how can i increase the Java heap size to the maximum (maximum 
memory pool)
using the apropicate script\configuration

which file/es should be changed acordinaly.

All the Best,
Yoav Lanenter
?   052-3562982
›  yo...@consist.co.il
"  http://thebobaba.blogspot.com/

Important notice: This e-mail and any attachment there to contains corporate 
proprietary information. If you have received it by mistake, please notify us 
immediately by reply e-mail and delete this e-mail and its attachments from 
your system.
Thank You.

Important notice: This e-mail and any attachment there to contains corporate 
proprietary information. If you have received it by mistake, please notify us 
immediately by reply e-mail and delete this e-mail and its attachments from 
your system.
Thank You.


RE: Java heap size limit

2010-02-10 Thread Hadole, Nishant IN BOM SISL
For 32 bit system, maximum memory pool can easily increased upto 2 GB.

1. If using batch start-up file
Add set CATALINA_OPTS=-Xms64M -Xmx128M in catlina.bat

2. If running as windows service, Using tomcat monitor --> java --> initial & 
maximum memory pool

With best regards,
Nishant Hadole
Siemens IT Solutions and Services
-Original Message-
From: Yoav Lanenter [mailto:yo...@consist.co.il]
Sent: Thursday, 11 February, 2010 11:48 AM
To: users@tomcat.apache.org
Subject: Java heap size limit




Hi,

my configuration is:

tomcat 5.5,Win Server 2003,32 bit,32 GB RAM

my question is how can i increase the Java heap size to the maximum (maximum 
memory pool)
using the apropicate script\configuration

which file/es should be changed acordinaly.

All the Best,
Yoav Lanenter
?   052-3562982
›  yo...@consist.co.il
"  http://thebobaba.blogspot.com/

Important notice: This e-mail and any attachment there to contains corporate 
proprietary information. If you have received it by mistake, please notify us 
immediately by reply e-mail and delete this e-mail and its attachments from 
your system.
Thank You.