RE: MaxPermSize, Tomcat startup trouble

2009-05-28 Thread Henjo


Caldarale, Charles R wrote:
 
 
 It's also irrelevant.  The heap size (-Xmx + -XX:MaxPermSize) must fit in
 a contiguous area of virtual memory within the process.  On a 32-bit
 Windows system, the process space is 2 GB, unfortunately very fragmented
 by DLLs that Windows insists on scattering throughout the area.  You will
 never be able to get a total heap larger than 1.2 - 1.5 GB.  (There is a
 boot-time switch in Windows Server to allow 3 GB user process space, but
 that can cause other problems for the OS.)
 
 The above is not possible to achieve on a 32-bit system - ever.  Shrink
 the MaxPermSize down to something reasonable (e.g., 128m), then experiment
 with -Xmx until the JVM loads.  Normally best to set -Xms and -Xmx to the
 same value.
 
  - Chuck
 
 
 

Thank you both for replying. The architecture is indeed x86 (Windows 2003
server) and changing OS is not an option right now (going live soon).

The strange thing is that if we place all 20 contexts in the Tomcat
6.0\webapps then we get this exception/error:

..backtrace..
Cause by  java.lang.OutOfMemoryError: PermGen space.

If we place the contexts outside of the Tomcat 6.0\webapps (updated
server.xml ofc), then we DON'T get the OutOfMemoryError.
Because we'd like to use the WAR update mechanism, keeping all webapps in
Tomcat 6.0\webapps is preferred.

-- 
View this message in context: 
http://www.nabble.com/MaxPermSize%2C-Tomcat-startup-trouble-tp23744089p23756562.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


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



RE: MaxPermSize, Tomcat startup trouble

2009-05-28 Thread Peter Crowther
 From: Henjo [mailto:henj...@gmail.com]
 Thank you both for replying. The architecture is indeed x86
 (Windows 2003
 server) and changing OS is not an option right now (going live soon).

The alternative view: You can go live with a known-unreliable system, or you 
can change OS and go live with a maybe-unreliable system :-).

 The strange thing is that if we place all 20 contexts in the Tomcat
 6.0\webapps then we get this exception/error:

 ..backtrace..
 Cause by  java.lang.OutOfMemoryError: PermGen space.

 If we place the contexts outside of the Tomcat 6.0\webapps (updated
 server.xml ofc), then we DON'T get the OutOfMemoryError.
 Because we'd like to use the WAR update mechanism, keeping
 all webapps in Tomcat 6.0\webapps is preferred.

I'm somewhat surprised.  Do all 20 contexts get started when they're elsewhere?

By the way, there's one other thing you *could* try if you had to reduce memory 
usage.  I don't like it, because it makes versioning the webapps a nightmare; 
but it might save you quite a lot of RAM and allow you to go live on the 
current hardware.  The choice is yours!

If many of your webapps use the same versions of the same jars, you *could* 
share them between webapps.  The classes will then be loaded once, rather than 
once per webapp, reducing the amount of PermGen required.  The problem, of 
course, is that your webapps are then locked to the same library versions - 
updating one webapp with a new library is a problem.

If you want to look at this approach, check the Tomcat 6 classloader how-to on 
the web site.  But if you do this, I would suggest you regard it as an 
emergency hack and look urgently at ways to remove it.

- Peter

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



RE: MaxPermSize, Tomcat startup trouble

2009-05-28 Thread Jeffrey Janner
Peter's option is a valid one.  I use this approach myself to limit the
size of PermGen.  Of course, I may have more control over the apps than
you do. If you do need to load different version, you should be able to
put the alternate version in the apps WEB-INF/lib directory and the
app's loader will prefer it. (at least at 5.5).
One thing to watch out for.  Some libraries do not play nice.  For
instance, log4j gets instantiated once for the jvm.  If you share the
lg4j library but each app has its own log file definition, they will end
up meshing into one log (I think the last one instantiated).

Jeff

-Original Message-
From: Peter Crowther [mailto:peter.crowt...@melandra.com] 
Sent: Thursday, May 28, 2009 4:03 AM
To: 'Tomcat Users List'
Subject: RE: MaxPermSize, Tomcat startup trouble


By the way, there's one other thing you *could* try if you had to reduce
memory usage.  I don't like it, because it makes versioning the webapps
a nightmare; but it might save you quite a lot of RAM and allow you to
go live on the current hardware.  The choice is yours!

If many of your webapps use the same versions of the same jars, you
*could* share them between webapps.  The classes will then be loaded
once, rather than once per webapp, reducing the amount of PermGen
required.  The problem, of course, is that your webapps are then locked
to the same library versions - updating one webapp with a new library is
a problem.

If you want to look at this approach, check the Tomcat 6 classloader
how-to on the web site.  But if you do this, I would suggest you regard
it as an emergency hack and look urgently at ways to remove it.

- Peter

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


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



RE: MaxPermSize, Tomcat startup trouble

2009-05-28 Thread Jeffrey Janner
 Any ideas how we can get a much larger PermSpace going?

I believe there are some java options that control how the memory is
divided between the different generations.
I seem to remember a ratio option that you could look into.  I had to do
this for one implementation.
Check the java documentation for your JVM.

Also, the maximum memory size you can supply to -Xmx is 1536M, and that
is only if you use the /3G boot option for Windows. Otherwise, it is
about 1200M.  Not much can be done about this.  It's an MS thing.

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


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



RE: MaxPermSize, Tomcat startup trouble

2009-05-28 Thread Caldarale, Charles R
 From: Jeffrey Janner [mailto:jeffrey.jan...@polydyne.com]
 Subject: RE: MaxPermSize, Tomcat startup trouble
 
 I believe there are some java options that control how the memory is
 divided between the different generations.

Not for PermGen - its size is controlled explicitly.  It's not really a 
generation in proper GC terminology - nothing ever migrates into it.

 I seem to remember a ratio option that you could look into.

That's only for young vs old generations.

 Also, the maximum memory size you can supply to -Xmx is 1536M

That's platform and architecture dependant; there's no single value that will 
work everywhere.  The next service pack will change it.

 - 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: MaxPermSize, Tomcat startup trouble

2009-05-28 Thread Jeffrey Janner
I know I increased the PermGen size.  I'll see if I can find it --
later.
The max -Xmx was specifically meant for Windows 32-bit.  Sorry that I
wasn't clear.

-Original Message-
From: Caldarale, Charles R [mailto:chuck.caldar...@unisys.com] 
Sent: Thursday, May 28, 2009 9:09 AM
To: Tomcat Users List
Subject: RE: MaxPermSize, Tomcat startup trouble

 From: Jeffrey Janner [mailto:jeffrey.jan...@polydyne.com]
 Subject: RE: MaxPermSize, Tomcat startup trouble
 
 I believe there are some java options that control how the memory is
 divided between the different generations.

Not for PermGen - its size is controlled explicitly.  It's not really a
generation in proper GC terminology - nothing ever migrates into it.

 I seem to remember a ratio option that you could look into.

That's only for young vs old generations.

 Also, the maximum memory size you can supply to -Xmx is 1536M

That's platform and architecture dependant; there's no single value that
will work everywhere.  The next service pack will change it.

 - 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



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


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



RE: MaxPermSize, Tomcat startup trouble

2009-05-28 Thread Jeffrey Janner
-XX:MaxPermSize=128m

Since it's an XX option, you need to verify that it is available with
your version of Java.

Jeff

-Original Message-
From: Jeffrey Janner [mailto:jeffrey.jan...@polydyne.com] 
Sent: Thursday, May 28, 2009 10:58 AM
To: Tomcat Users List
Subject: RE: MaxPermSize, Tomcat startup trouble

I know I increased the PermGen size.  I'll see if I can find it --
later.
The max -Xmx was specifically meant for Windows 32-bit.  Sorry that I
wasn't clear.

-Original Message-
From: Caldarale, Charles R [mailto:chuck.caldar...@unisys.com] 
Sent: Thursday, May 28, 2009 9:09 AM
To: Tomcat Users List
Subject: RE: MaxPermSize, Tomcat startup trouble

 From: Jeffrey Janner [mailto:jeffrey.jan...@polydyne.com]
 Subject: RE: MaxPermSize, Tomcat startup trouble
 
 I believe there are some java options that control how the memory is
 divided between the different generations.

Not for PermGen - its size is controlled explicitly.  It's not really a
generation in proper GC terminology - nothing ever migrates into it.

 I seem to remember a ratio option that you could look into.

That's only for young vs old generations.

 Also, the maximum memory size you can supply to -Xmx is 1536M

That's platform and architecture dependant; there's no single value that
will work everywhere.  The next service pack will change it.

 - 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



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


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



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


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



RE: MaxPermSize, Tomcat startup trouble

2009-05-27 Thread Caldarale, Charles R
 From: Henjo [mailto:henj...@gmail.com]
 Subject: MaxPermSize, Tomcat startup trouble
 
 AFAIK the PermSpace holds all compiled java classes (and jsps) in RAM.

No; it holds the java.lang.Class instances that represent the loaded classes 
(including JSPs).  Size of a class file on disk has *nothing* to do with the 
size of a java.lang.Class object.  The number of webapps and JSPs you have is 
not particularly large.

 Available RAM is 3.5Gb on the machine, so that's not a problem.

It's also irrelevant.  The heap size (-Xmx + -XX:MaxPermSize) must fit in a 
contiguous area of virtual memory within the process.  On a 32-bit Windows 
system, the process space is 2 GB, unfortunately very fragmented by DLLs that 
Windows insists on scattering throughout the area.  You will never be able to 
get a total heap larger than 1.2 - 1.5 GB.  (There is a boot-time switch in 
Windows Server to allow 3 GB user process space, but that can cause other 
problems for the OS.)

 -Xmx1536m
 -XX:MaxPermSize=1024m

The above is not possible to achieve on a 32-bit system - ever.  Shrink the 
MaxPermSize down to something reasonable (e.g., 128m), then experiment with 
-Xmx until the JVM loads.  Normally best to set -Xms and -Xmx to the same value.

 -XX:+CMSPermGenSweepingEnabled

Irrelevant unless you have enabled the concurrent mark-sweep GC mechanism.

 - 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: MaxPermSize, Tomcat startup trouble

2009-05-27 Thread Peter Crowther
 From: Henjo [henj...@gmail.com]
 OS is Windows 2003.

x86 or x64?

 Available RAM is 3.5Gb on the machine, so that's not a problem.

I assume x86 from that sizing.  As Chuck points out, you won't get the space 
you want given Windows' appalling memory use.

 Any ideas how we can get a much larger PermSpace going?

Change to an x64 Windows architecture, or change to a non-Windows OS (may not 
be large enough, even so), or run two (or more) Tomcat instances on the machine 
and split the contexts between them so that you don't need 1G of Permspace.

- Peter

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