Re: java.lang.OutOfMemoryError: PermGen space when we redeploy same application multiple times

2020-10-12 Thread Prabhu Gurunathan
Thanks Manuel Dominguez

On Mon, Oct 12, 2020 at 5:51 PM Manuel Dominguez Sarmiento
 wrote:
>
> The articles in this page will be helpful:
> https://java.jiderhamn.se/category/classloader-leaks/
>
> On 12/10/2020 04:19, Mark Thomas wrote:
> > On 11/10/2020 02:39, Prabhu Gurunathan wrote:
> >> Hi All,
> >>
> >> We have an setup where we are using OpenJDK 1.7 and Tomcat 7.0.100 ,
> >> in CentOs 7 Env . and we have many application deployed in
> >> Tomcat/webapps and the common lib's needed for those apps are kept in
> >> Tomcat/lib directory like log4j , commons-fileupload  ,xerces , Xalan
> >> .. etc
> >>
> >> The problem here is When we try to undeploy and deploy same
> >> applications multiple time we are  getting into
> >> java.lang.OutOfMemoryError: PermGen space very quickly . Want to know
> >> is it very generic problem on this deployment model or is this can be
> >> fixed anyway ?
> > The memory leak could be in any of:
> > - the application code
> > - a library the application depends on
> > - the JVM
> > - Tomcat
> >
> > In all cases, it should be possible to fix it. There might even be a
> > short-term workaround available.
> >
> > First of all, make sure that the JreMemoryLeakPreventionListener is
> > enabled in your configuration.
> >
> > Secondly, make sure that you don't get any warnings about possible
> > memory leaks in the logs when you reload an application. If you do, fix
> > the leaks identified.
> >
> > If you still see issues, the short version is:
> > - user a profiler
> > - reload each app in turn until you see more strong references to
> >org.apache.catalina.loader.[Parallel]WebappClassLoader instances in
> >memory than you have web applications
> > - find the one where started = false
> > - trace its GC roots
> > - that will tell you where the memory leak is
> > - how it was created might be harder to track down
> >
> > The long version is in a presentation linked from the Tomcat web site:
> > https://home.apache.org/~markt/presentations/2010-08-05-Memory-Leaks-JavaOne-60mins.pdf
> >
> > If you have any questions, you can ask here.
> >
> > Mark
> >
> > -
> > To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> > For additional commands, e-mail: users-h...@tomcat.apache.org
> >
>

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



Re: java.lang.OutOfMemoryError: PermGen space when we redeploy same application multiple times

2020-10-12 Thread Manuel Dominguez Sarmiento

The articles in this page will be helpful:
https://java.jiderhamn.se/category/classloader-leaks/

On 12/10/2020 04:19, Mark Thomas wrote:

On 11/10/2020 02:39, Prabhu Gurunathan wrote:

Hi All,

We have an setup where we are using OpenJDK 1.7 and Tomcat 7.0.100 ,
in CentOs 7 Env . and we have many application deployed in
Tomcat/webapps and the common lib's needed for those apps are kept in
Tomcat/lib directory like log4j , commons-fileupload  ,xerces , Xalan
.. etc

The problem here is When we try to undeploy and deploy same
applications multiple time we are  getting into
java.lang.OutOfMemoryError: PermGen space very quickly . Want to know
is it very generic problem on this deployment model or is this can be
fixed anyway ?

The memory leak could be in any of:
- the application code
- a library the application depends on
- the JVM
- Tomcat

In all cases, it should be possible to fix it. There might even be a
short-term workaround available.

First of all, make sure that the JreMemoryLeakPreventionListener is
enabled in your configuration.

Secondly, make sure that you don't get any warnings about possible
memory leaks in the logs when you reload an application. If you do, fix
the leaks identified.

If you still see issues, the short version is:
- user a profiler
- reload each app in turn until you see more strong references to
   org.apache.catalina.loader.[Parallel]WebappClassLoader instances in
   memory than you have web applications
- find the one where started = false
- trace its GC roots
- that will tell you where the memory leak is
- how it was created might be harder to track down

The long version is in a presentation linked from the Tomcat web site:
https://home.apache.org/~markt/presentations/2010-08-05-Memory-Leaks-JavaOne-60mins.pdf

If you have any questions, you can ask here.

Mark

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





Re: java.lang.OutOfMemoryError: PermGen space when we redeploy same application multiple times

2020-10-12 Thread Prabhu Gurunathan
Thanks Mark , for your thoughts , will explore more and get back .

On Mon, Oct 12, 2020 at 12:49 PM Mark Thomas  wrote:
>
> On 11/10/2020 02:39, Prabhu Gurunathan wrote:
> > Hi All,
> >
> > We have an setup where we are using OpenJDK 1.7 and Tomcat 7.0.100 ,
> > in CentOs 7 Env . and we have many application deployed in
> > Tomcat/webapps and the common lib's needed for those apps are kept in
> > Tomcat/lib directory like log4j , commons-fileupload  ,xerces , Xalan
> > .. etc
> >
> > The problem here is When we try to undeploy and deploy same
> > applications multiple time we are  getting into
> > java.lang.OutOfMemoryError: PermGen space very quickly . Want to know
> > is it very generic problem on this deployment model or is this can be
> > fixed anyway ?
>
> The memory leak could be in any of:
> - the application code
> - a library the application depends on
> - the JVM
> - Tomcat
>
> In all cases, it should be possible to fix it. There might even be a
> short-term workaround available.
>
> First of all, make sure that the JreMemoryLeakPreventionListener is
> enabled in your configuration.
>
> Secondly, make sure that you don't get any warnings about possible
> memory leaks in the logs when you reload an application. If you do, fix
> the leaks identified.
>
> If you still see issues, the short version is:
> - user a profiler
> - reload each app in turn until you see more strong references to
>   org.apache.catalina.loader.[Parallel]WebappClassLoader instances in
>   memory than you have web applications
> - find the one where started = false
> - trace its GC roots
> - that will tell you where the memory leak is
> - how it was created might be harder to track down
>
> The long version is in a presentation linked from the Tomcat web site:
> https://home.apache.org/~markt/presentations/2010-08-05-Memory-Leaks-JavaOne-60mins.pdf
>
> If you have any questions, you can ask here.
>
> Mark
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>

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



Re: java.lang.OutOfMemoryError: PermGen space when we redeploy same application multiple times

2020-10-12 Thread Mark Thomas
On 11/10/2020 02:39, Prabhu Gurunathan wrote:
> Hi All,
> 
> We have an setup where we are using OpenJDK 1.7 and Tomcat 7.0.100 ,
> in CentOs 7 Env . and we have many application deployed in
> Tomcat/webapps and the common lib's needed for those apps are kept in
> Tomcat/lib directory like log4j , commons-fileupload  ,xerces , Xalan
> .. etc
> 
> The problem here is When we try to undeploy and deploy same
> applications multiple time we are  getting into
> java.lang.OutOfMemoryError: PermGen space very quickly . Want to know
> is it very generic problem on this deployment model or is this can be
> fixed anyway ?

The memory leak could be in any of:
- the application code
- a library the application depends on
- the JVM
- Tomcat

In all cases, it should be possible to fix it. There might even be a
short-term workaround available.

First of all, make sure that the JreMemoryLeakPreventionListener is
enabled in your configuration.

Secondly, make sure that you don't get any warnings about possible
memory leaks in the logs when you reload an application. If you do, fix
the leaks identified.

If you still see issues, the short version is:
- user a profiler
- reload each app in turn until you see more strong references to
  org.apache.catalina.loader.[Parallel]WebappClassLoader instances in
  memory than you have web applications
- find the one where started = false
- trace its GC roots
- that will tell you where the memory leak is
- how it was created might be harder to track down

The long version is in a presentation linked from the Tomcat web site:
https://home.apache.org/~markt/presentations/2010-08-05-Memory-Leaks-JavaOne-60mins.pdf

If you have any questions, you can ask here.

Mark

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



Re: java.lang.OutOfMemoryError: PermGen space

2016-10-21 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Jon,

On 10/21/16 3:46 AM, Moore, Jon, Vodafone UK wrote:
> Yes I am a novice at Java as well. I support the IVR system that 
> points to the application servers and have ended up trying to
> resolve this issue as our developers of the applications can't
> help.

Understood. Welcome to the Java world. :)

> The way we are told on the training to deploy the application in
> the IVR is to use the deploy/un-deploy options in tomcat manager. I
> have also seen a colleague make a copy of the applications war file
> away from its normal folder (webapps), stop the tomcat Windows
> service, delete the applications deployed folder and restart the
> tomcat windows service to re-deploy the application.

Since you are using manager-based deply/undeploy, you could very well
be running into a classloader-pinning error. If there's no hope of
modifying the code to fix any leaks, the only remedy is to bounce the
entire JVM after a certain number of redeploy operations. If you find
that you can redeploy 10 times before you get permgen OOMEs, then
you'll need to keep a count and restart after e.g. 8 redeployments.

If you *can* fix the code, the manager has a "find memory leaks"
button that can help you find out if an application has not undeployed
properly: deploy the application in a fresh Tomcat start-up. Then,
undeploy the application, wait 5-10 seconds, and click the "find
memory leaks" button. If it syas there are no leaks, then you may just
need a slightly larger permgen in general and you'll be fine.

If it says there are problems, start a new thread on this mailing list
asking for help identifying and fixing those leaks.

> I have tried to run the commands you suggested from a CMD box but 
> nothing gets outputted.

Hmm.

Try NOT piping-through the FINDSTR program and looking at the output
of the initial "java" command. I don't have a Windows system to play
with ATM so I'm doing a bit of guesswork, here. "FIND" is garbage
compared to a proper "grep". I had never even heard of FINDSTR before.

- -chris

> -Original Message- From: Christopher Schultz 
> [mailto:ch...@christopherschultz.net] Sent: 20 October 2016 17:40
> To: Tomcat Users List Subject: Re: java.lang.OutOfMemoryError:
> PermGen space
> 
> Jon,
> 
> On 10/20/16 6:00 AM, Moore, Jon, Vodafone UK wrote:
>> I have a problem where our customers application server stops 
>> working intermittently and when we check the Tomcat logs we get
>> the message " java.lang.OutOfMemoryError: PermGen space" but the
>> Tomcat service is still running, and we have to restart the
>> Tomcat service. I am a complete novice when it comes to Tomcat
>> but am expected to resolve this issue as this server is part of
>> the Avaya telephony solution.
> 
>> I have 2 questions please.
> 
>> 1 - What would be causing this.
> 
> Are you also a Java novice as well? No judgement... I just want to 
> adjust my level of snark appropriately :)
> 
> Java has a special heap space called the "permanent generation" (a 
> term which becomes less descriptive as time goes on) but basically 
> all java.lang.Class objects loaded by the JVM go there. The more 
> libraries and other stuff that gets loaded, the more space in
> permgen is used. The defaults for the size of permgen are often
> fairly small, and you may have to raise them. This is especially
> true for applications that use large frameworks like Spring.
> 
> Raising the permgen space is almost always the right decision
> under normal circumstances when you get an OOME:permgen error. I
> would double whatever its current value is and monitor the
> application for a while to see if that improves things.
> 
> The only situation I know of where raising the permgen size is not 
> the right move is when there is a "classloader-pinning leak". That 
> happens when you hot-deploy an application many times, but the old 
> versions of the application are not undeploying cleanly. This 
> situation is quite the rabbit-hole, so I'll stop there unless you
> can confirm that you do hot-deployments without restarting Tomcat
> and the JVM.
> 
> If you instead get OOME for other reasons, it's frequently NOT the 
> right decision to increase the heap size because it usually
> indicates that there is a memory leak in the application and giving
> it more heap just means you'll wait longer between failures.
> Instead, the application should be fixed to not leak memory :)
> 
>> 2 - What are the default Java memory settings for Initial memory 
>> pool, maximum memory pool size and thread stack size when the 
>> fields are blank when you use the "Configure Tomcat" interface
>> on Wi

Re: java.lang.OutOfMemoryError: PermGen space

2016-10-21 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

André,

On 10/21/16 11:15 AM, André Warnier (tomcat) wrote:
> Hi. Understood. Make sure that you are looking at the "Java" tab.

And at the right Service name. The tomcat6w.exe can be used to
configure any number of services. If you've got the wrong one, you'll
be configuring something OTHER than what you want to configure.

Do you have multiple Tomcat6-based services configured? If so, make
sure you are editing the right now.

> I have an old installation of Tomcat 6 on my laptop, and took a 
> screenshot of that tab. I am not sure that the image that I attach
> will make it on the list however (it strips most attachments). If
> not, here are the parameters which I see in the Java tab, in the
> box "Java Options" :
> 
> -Djava.io.tmpdir=C:\apache-tomcat-6.0.24\temp 
> -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager 
> -Djava.util.logging.config.file=C:\apache-tomcat-6.0.24\conf\logging.p
roperties
>
> 
> 
> There is nothing about memory there, but this is where you should
> add the relevant switches for the Java PermGen, one per line.
> 
> Further down, there are 3 more boxes :
> 
> Initial memory pool : 128 MB Maximum memory pool : 256 MB Thread
> stack size : (blank)
> 
> The first 2 are the Java Heap size (which is not your problem). On
> my laptop, the JVM for the above is Sun's jdk7_u45. Your mileage
> may vary..
> 
> There may be more to find out searching Google for "java default
> memory settings" or similar.
> 
> This link provides an example of a setting for Java 6 / Tomcat 7 : 
> http://stackoverflow.com/questions/21104340/increase-windows-installer
- -based-tomcat-permgen-space
>
> 
> 
> I saw something somewhere which mentioned 64 MB as the default
> PermGen (no guarantees).
> 
> Another proviso : at this point, I am not quite sure if the PermGen
> is or not a part of the Heap (Chuck ?).

PermGen is not a part of any other heap space: it is separate.

> If it is, and you increase the PermGen, you may need to also
> increase the Heap size accordingly (see the 2 boxes above).

Not necessary.

> For maximum performance, it is also recommended to set the
> "initial" and "maximum" Heap size values above to the same value
> (use the maximum of course), as this avoids the JVM spending some
> time resizing the heap dynamically.
> 
> In any case, and still without guarantees or liability of any
> kind, if you have enough memory on that server, it would probably
> not hurt to set the following :
> 
> Initial memory pool : 1024 MB Maximum memory pool : 1024 MB

Eh. I wouldn't increase anything you don't need to increase. I've seen
JVMs configured for huge heaps on multi-tenant VMs that have
over-committed the physical hardware. The hypervisor does what it can,
and every VM runs slow as a dog. If you don't need a gig of RAM, don't
requested it.

> and add the options -XX:PermSize=128m -XX:MaxPermSize=128m
> 
> to the Java Options.

+1

- -chris

> On 21.10.2016 16:25, Moore, Jon, Vodafone UK wrote:
>> Thanks Andre.
>> 
>> When I open up tomcat6w.exe the fields are all blank, hence
>> trying to find out what the defaults are before I enter anything
>> in them as I don't want to put in a lesser value then the
>> defaults.
>> 
>> -Original Message- From: André Warnier (tomcat)
>> [mailto:a...@ice-sa.com] Sent: 21 October 2016 09:34 To:
>> users@tomcat.apache.org Subject: Re: java.lang.OutOfMemoryError:
>> PermGen space
>> 
>> On 21.10.2016 09:46, Moore, Jon, Vodafone UK wrote:
>>> Thanks Chris. (and to everyone else who has replied)
>>> 
>>> Yes I am a novice at Java as well. I support the IVR system
>>> that points to the application servers and have ended up trying
>>> to resolve this issue as our developers of the applications
>>> can't help.
>>> 
>>> The way we are told on the training to deploy the application
>>> in the IVR is to use the deploy/un-deploy options in tomcat
>>> manager. I have also seen a colleague make a copy of the
>>> applications war file away from its normal folder (webapps),
>>> stop the tomcat Windows service, delete the applications
>>> deployed folder and restart the tomcat windows service to
>>> re-deploy the application.
>>> 
>>> I have tried to run the commands you suggested from a CMD box
>>> but nothing gets outputted.
>>> 
>> 
>> Some additional info :
>> 
>> When Tomcat is running as a Service under Windows, the Java 
>> command-line switches (which allow to control the Java memory
>> sizes among other tings), are sto

RE: java.lang.OutOfMemoryError: PermGen space

2016-10-21 Thread Berneburg, Cris J. - US
Hi Jon

-Original Message-
From: Moore, Jon, Vodafone UK [mailto:jon.mo...@vodafone.com] 
Sent: Thursday, October 20, 2016 6:00 AM
To: users@tomcat.apache.org
Subject: java.lang.OutOfMemoryError: PermGen space

> I have a problem where our customers application server stops
> working intermittently and when we check the Tomcat logs we get the
> message " java.lang.OutOfMemoryError: PermGen space" but the Tomcat
> service is still running, and we have to restart the Tomcat service. I
> am a complete novice when it comes to Tomcat but am expected to
> resolve this issue as this server is part of the Avaya telephony
> solution.
>
> I have 2 questions please.
>
> 1 - What would be causing this.

In my very limited experience it is likely a "memory leak" in your application 
"hosted" inside of Tomcat rather than Tomcat itself.  You will need to debug 
your application.

I went through something very similar starting in July 2016, starting off as a 
complete newbie.  See threads relating to "OutOfMemoryError: PermGen space" for 
the whole sorry affair.  :-)

> 2 - What are the default Java memory settings for Initial memory pool,
> maximum memory pool size and thread stack size when the fields are
> blank when you use the "Configure Tomcat" interface on Windows. I was
> wondering if changing one or more of these settings would help ?

FWIW, I agree with the other folks saying not to alter these settings as the 
solution to solve your problem.  If you have a memory leak, increasing the size 
of the memory will not stop the leak.

I suggest following a path that was recommended to me.  Start by reading this:

http://markmail.org/message/fcbvwapt6afyndxn

> 1. Find an app that you can't reload without OOME.
> 2. Get a profiler [...]
> 3. Reload you app once.
> 4. Use the profiler to look for instances of WebappClassLoader.
> 5. Look for the one with the started attribute == false.
> 6. Trace the GC roots for this instance.

In the process, I learned how to perform a Java "heap dump" and how to use a 
memory analyzer.  FYI, I used Eclipse Memory Analyzer (free) to track things 
down.  This will be a learning experience for you too.  ;-)

> We are running Tomcat 6.0.26 on Windows Server 2008 R2 standard and
> JVM version is 1.6.0_20-b02

Thanks for providing those details.  :-)  We had almost the same setup as you, 
but Win2012 instead of 2008.  FYI, upgrading from Java 6 to 8 did not fix my 
memory leak.

Good luck, and let us know your progress!

--
Cris Berneburg
CACI Lead Software Engineer


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



Re: java.lang.OutOfMemoryError: PermGen space

2016-10-21 Thread tomcat

Hi.
Understood.
Make sure that you are looking at the "Java" tab.

I have an old installation of Tomcat 6 on my laptop, and took a screenshot of 
that tab.
I am not sure that the image that I attach will make it on the list however (it strips 
most attachments).

If not, here are the parameters which I see in the Java tab, in the box "Java 
Options" :

-Djava.io.tmpdir=C:\apache-tomcat-6.0.24\temp
-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
-Djava.util.logging.config.file=C:\apache-tomcat-6.0.24\conf\logging.properties

There is nothing about memory there, but this is where you should add the relevant 
switches for the Java PermGen, one per line.


Further down, there are 3 more boxes :

Initial memory pool : 128 MB
Maximum memory pool : 256 MB
Thread stack size : (blank)

The first 2 are the Java Heap size (which is not your problem).
On my laptop, the JVM for the above is Sun's jdk7_u45.
Your mileage may vary..

There may be more to find out searching Google for "java default memory 
settings" or similar.

This link provides an example of a setting for Java 6 / Tomcat 7 :
http://stackoverflow.com/questions/21104340/increase-windows-installer-based-tomcat-permgen-space

I saw something somewhere which mentioned 64 MB as the default PermGen (no 
guarantees).

Another proviso : at this point, I am not quite sure if the PermGen is or not a part of 
the Heap (Chuck ?).
If it is, and you increase the PermGen, you may need to also increase the Heap size 
accordingly (see the 2 boxes above).


For maximum performance, it is also recommended to set the "initial" and "maximum" Heap 
size values above to the same value (use the maximum of course), as this avoids the JVM 
spending some time resizing the heap dynamically.


In any case, and still without guarantees or liability of any kind,
if you have enough memory on that server, it would probably not hurt to set the 
following :

Initial memory pool : 1024 MB
Maximum memory pool : 1024 MB

and add the options
-XX:PermSize=128m
-XX:MaxPermSize=128m

to the Java Options.



On 21.10.2016 16:25, Moore, Jon, Vodafone UK wrote:

Thanks Andre.

When I open up tomcat6w.exe the fields are all blank, hence trying to find out 
what the defaults are before I enter anything in them as I don't want to put in 
a lesser value then the defaults.

-Original Message-
From: André Warnier (tomcat) [mailto:a...@ice-sa.com]
Sent: 21 October 2016 09:34
To: users@tomcat.apache.org
Subject: Re: java.lang.OutOfMemoryError: PermGen space

On 21.10.2016 09:46, Moore, Jon, Vodafone UK wrote:

Thanks Chris. (and to everyone else who has replied)

Yes I am a novice at Java as well. I support the IVR system that points to the 
application servers and have ended up trying to resolve this issue as our 
developers of the applications can't help.

The way we are told on the training to deploy the application in the IVR is to 
use the deploy/un-deploy options in tomcat manager. I have also seen a 
colleague make a copy of the applications war file away from its normal folder 
(webapps), stop the tomcat Windows service, delete the applications deployed 
folder and restart the tomcat windows service to re-deploy the application.

I have tried to run the commands you suggested from a CMD box but nothing gets 
outputted.



Some additional info :

When Tomcat is running as a Service under Windows, the Java command-line switches (which 
allow to control the Java memory sizes among other tings), are stored in the Windows 
Registry.  The Windows Tomcat-as-a-Service installation includes a program (named 
"tomcat(version)w.exe", which is a kind of GUI Registry Editor, specially for 
these Java/Tomcat related parameters.  Normally, this program is running, and appears as 
a small Apache icon at the bottom right of the console.
That is the program that you should use, to change the Java startup parameters, 
and stop/start Tomcat.

As explained in previous posts here on this list, and in some of the articles 
to which I pointed you in Google, it may be that your issue is only that the 
default PermGen size, is insufficient for your application(s), and that just 
increasing the Java PermGen size would solve the problem definitely.

Or not, if the application is flawed. But you can at least try.

For the full story about tomcat(x)w.exe, try the Tomcat FAQ (which does not seem to be 
on-line right now, or very slow), and look for an article entitled "what are 
tomcatx.exe and tomcatxw.exe".
Ah, here : http://wiki.apache.org/tomcat/FAQ/Windows




-Original Message-
From: Christopher Schultz [mailto:ch...@christopherschultz.net]
Sent: 20 October 2016 17:40
To: Tomcat Users List
Subject: Re: java.lang.OutOfMemoryError: PermGen space

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Jon,

On 10/20/16 6:00 AM, Moore, Jon, Vodafone UK wrote:

I have a problem where our customers application server stops worki

RE: java.lang.OutOfMemoryError: PermGen space

2016-10-21 Thread Moore, Jon, Vodafone UK
Thanks Andre.

When I open up tomcat6w.exe the fields are all blank, hence trying to find out 
what the defaults are before I enter anything in them as I don't want to put in 
a lesser value then the defaults.

-Original Message-
From: André Warnier (tomcat) [mailto:a...@ice-sa.com] 
Sent: 21 October 2016 09:34
To: users@tomcat.apache.org
Subject: Re: java.lang.OutOfMemoryError: PermGen space

On 21.10.2016 09:46, Moore, Jon, Vodafone UK wrote:
> Thanks Chris. (and to everyone else who has replied)
>
> Yes I am a novice at Java as well. I support the IVR system that points to 
> the application servers and have ended up trying to resolve this issue as our 
> developers of the applications can't help.
>
> The way we are told on the training to deploy the application in the IVR is 
> to use the deploy/un-deploy options in tomcat manager. I have also seen a 
> colleague make a copy of the applications war file away from its normal 
> folder (webapps), stop the tomcat Windows service, delete the applications 
> deployed folder and restart the tomcat windows service to re-deploy the 
> application.
>
> I have tried to run the commands you suggested from a CMD box but nothing 
> gets outputted.
>

Some additional info :

When Tomcat is running as a Service under Windows, the Java command-line 
switches (which allow to control the Java memory sizes among other tings), are 
stored in the Windows Registry.  The Windows Tomcat-as-a-Service installation 
includes a program (named "tomcat(version)w.exe", which is a kind of GUI 
Registry Editor, specially for these Java/Tomcat related parameters.  Normally, 
this program is running, and appears as a small Apache icon at the bottom right 
of the console.
That is the program that you should use, to change the Java startup parameters, 
and stop/start Tomcat.

As explained in previous posts here on this list, and in some of the articles 
to which I pointed you in Google, it may be that your issue is only that the 
default PermGen size, is insufficient for your application(s), and that just 
increasing the Java PermGen size would solve the problem definitely.

Or not, if the application is flawed. But you can at least try.

For the full story about tomcat(x)w.exe, try the Tomcat FAQ (which does not 
seem to be on-line right now, or very slow), and look for an article entitled 
"what are tomcatx.exe and tomcatxw.exe".
Ah, here : http://wiki.apache.org/tomcat/FAQ/Windows


>
> -Original Message-
> From: Christopher Schultz [mailto:ch...@christopherschultz.net]
> Sent: 20 October 2016 17:40
> To: Tomcat Users List
> Subject: Re: java.lang.OutOfMemoryError: PermGen space
>
> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA256
>
> Jon,
>
> On 10/20/16 6:00 AM, Moore, Jon, Vodafone UK wrote:
>> I have a problem where our customers application server stops working 
>> intermittently and when we check the Tomcat logs we get the message "
>> java.lang.OutOfMemoryError: PermGen space" but the Tomcat service is 
>> still running, and we have to restart the Tomcat service. I am a 
>> complete novice when it comes to Tomcat but am expected to resolve 
>> this issue as this server is part of the Avaya telephony solution.
>>
>> I have 2 questions please.
>>
>> 1 - What would be causing this.
>
> Are you also a Java novice as well? No judgement... I just want to 
> adjust my level of snark appropriately :)
>
> Java has a special heap space called the "permanent generation" (a term which 
> becomes less descriptive as time goes on) but basically all java.lang.Class 
> objects loaded by the JVM go there. The more libraries and other stuff that 
> gets loaded, the more space in permgen is used.
> The defaults for the size of permgen are often fairly small, and you may have 
> to raise them. This is especially true for applications that use large 
> frameworks like Spring.
>
> Raising the permgen space is almost always the right decision under normal 
> circumstances when you get an OOME:permgen error. I would double whatever its 
> current value is and monitor the application for a while to see if that 
> improves things.
>
> The only situation I know of where raising the permgen size is not the right 
> move is when there is a "classloader-pinning leak". That happens when you 
> hot-deploy an application many times, but the old versions of the application 
> are not undeploying cleanly. This situation is quite the rabbit-hole, so I'll 
> stop there unless you can confirm that you do hot-deployments without 
> restarting Tomcat and the JVM.
>
> If you instead get OOME for other reasons, it's frequently NOT the 
> right decision to increase the heap size because it usually indicates 
> that there is 

Re: java.lang.OutOfMemoryError: PermGen space

2016-10-21 Thread tomcat

On 21.10.2016 09:46, Moore, Jon, Vodafone UK wrote:

Thanks Chris. (and to everyone else who has replied)

Yes I am a novice at Java as well. I support the IVR system that points to the 
application servers and have ended up trying to resolve this issue as our 
developers of the applications can't help.

The way we are told on the training to deploy the application in the IVR is to 
use the deploy/un-deploy options in tomcat manager. I have also seen a 
colleague make a copy of the applications war file away from its normal folder 
(webapps), stop the tomcat Windows service, delete the applications deployed 
folder and restart the tomcat windows service to re-deploy the application.

I have tried to run the commands you suggested from a CMD box but nothing gets 
outputted.



Some additional info :

When Tomcat is running as a Service under Windows, the Java command-line switches (which 
allow to control the Java memory sizes among other tings), are stored in the Windows 
Registry.  The Windows Tomcat-as-a-Service installation includes a program (named 
"tomcat(version)w.exe", which is a kind of GUI Registry Editor, specially for these 
Java/Tomcat related parameters.  Normally, this program is running, and appears as a small 
Apache icon at the bottom right of the console.
That is the program that you should use, to change the Java startup parameters, and 
stop/start Tomcat.


As explained in previous posts here on this list, and in some of the articles to which I 
pointed you in Google, it may be that your issue is only that the default PermGen size, is 
insufficient for your application(s), and that just increasing the Java PermGen size would 
solve the problem definitely.


Or not, if the application is flawed. But you can at least try.

For the full story about tomcat(x)w.exe, try the Tomcat FAQ (which does not seem to be 
on-line right now, or very slow), and look for an article entitled "what are tomcatx.exe 
and tomcatxw.exe".

Ah, here : http://wiki.apache.org/tomcat/FAQ/Windows




-Original Message-
From: Christopher Schultz [mailto:ch...@christopherschultz.net]
Sent: 20 October 2016 17:40
To: Tomcat Users List
Subject: Re: java.lang.OutOfMemoryError: PermGen space

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Jon,

On 10/20/16 6:00 AM, Moore, Jon, Vodafone UK wrote:

I have a problem where our customers application server stops working
intermittently and when we check the Tomcat logs we get the message "
java.lang.OutOfMemoryError: PermGen space" but the Tomcat service is
still running, and we have to restart the Tomcat service. I am a
complete novice when it comes to Tomcat but am expected to resolve
this issue as this server is part of the Avaya telephony solution.

I have 2 questions please.

1 - What would be causing this.


Are you also a Java novice as well? No judgement... I just want to adjust my 
level of snark appropriately :)

Java has a special heap space called the "permanent generation" (a term which 
becomes less descriptive as time goes on) but basically all java.lang.Class objects 
loaded by the JVM go there. The more libraries and other stuff that gets loaded, the more 
space in permgen is used.
The defaults for the size of permgen are often fairly small, and you may have 
to raise them. This is especially true for applications that use large 
frameworks like Spring.

Raising the permgen space is almost always the right decision under normal 
circumstances when you get an OOME:permgen error. I would double whatever its 
current value is and monitor the application for a while to see if that 
improves things.

The only situation I know of where raising the permgen size is not the right move is when 
there is a "classloader-pinning leak". That happens when you hot-deploy an 
application many times, but the old versions of the application are not undeploying 
cleanly. This situation is quite the rabbit-hole, so I'll stop there unless you can 
confirm that you do hot-deployments without restarting Tomcat and the JVM.

If you instead get OOME for other reasons, it's frequently NOT the right 
decision to increase the heap size because it usually indicates that there is a 
memory leak in the application and giving it more heap just means you'll wait 
longer between failures. Instead, the application should be fixed to not leak 
memory :)


2 - What are the default Java memory settings for Initial memory pool,
maximum memory pool size and thread stack size when the fields are
blank when you use the "Configure Tomcat" interface on Windows. I was
wondering if changing one or more of these settings would help ?


The default depends upon the JVM and the OS.


We are running Tomcat 6.0.26 on Windows Server 2008 R2 standard and
JVM version is 1.6.0_20-b02


Best way to find out for sure[1] is:

C:\> java -XX:+PrintFlagsFinal -version 2>&1 | findstr HeapSize

The two settings you are looking for are 

RE: java.lang.OutOfMemoryError: PermGen space

2016-10-21 Thread Moore, Jon, Vodafone UK
Thanks Chris. (and to everyone else who has replied)

Yes I am a novice at Java as well. I support the IVR system that points to the 
application servers and have ended up trying to resolve this issue as our 
developers of the applications can't help.

The way we are told on the training to deploy the application in the IVR is to 
use the deploy/un-deploy options in tomcat manager. I have also seen a 
colleague make a copy of the applications war file away from its normal folder 
(webapps), stop the tomcat Windows service, delete the applications deployed 
folder and restart the tomcat windows service to re-deploy the application.

I have tried to run the commands you suggested from a CMD box but nothing gets 
outputted.

Regards

Jon Moore 

-Original Message-
From: Christopher Schultz [mailto:ch...@christopherschultz.net] 
Sent: 20 October 2016 17:40
To: Tomcat Users List
Subject: Re: java.lang.OutOfMemoryError: PermGen space

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Jon,

On 10/20/16 6:00 AM, Moore, Jon, Vodafone UK wrote:
> I have a problem where our customers application server stops working 
> intermittently and when we check the Tomcat logs we get the message " 
> java.lang.OutOfMemoryError: PermGen space" but the Tomcat service is 
> still running, and we have to restart the Tomcat service. I am a 
> complete novice when it comes to Tomcat but am expected to resolve 
> this issue as this server is part of the Avaya telephony solution.
> 
> I have 2 questions please.
> 
> 1 - What would be causing this.

Are you also a Java novice as well? No judgement... I just want to adjust my 
level of snark appropriately :)

Java has a special heap space called the "permanent generation" (a term which 
becomes less descriptive as time goes on) but basically all java.lang.Class 
objects loaded by the JVM go there. The more libraries and other stuff that 
gets loaded, the more space in permgen is used.
The defaults for the size of permgen are often fairly small, and you may have 
to raise them. This is especially true for applications that use large 
frameworks like Spring.

Raising the permgen space is almost always the right decision under normal 
circumstances when you get an OOME:permgen error. I would double whatever its 
current value is and monitor the application for a while to see if that 
improves things.

The only situation I know of where raising the permgen size is not the right 
move is when there is a "classloader-pinning leak". That happens when you 
hot-deploy an application many times, but the old versions of the application 
are not undeploying cleanly. This situation is quite the rabbit-hole, so I'll 
stop there unless you can confirm that you do hot-deployments without 
restarting Tomcat and the JVM.

If you instead get OOME for other reasons, it's frequently NOT the right 
decision to increase the heap size because it usually indicates that there is a 
memory leak in the application and giving it more heap just means you'll wait 
longer between failures. Instead, the application should be fixed to not leak 
memory :)

> 2 - What are the default Java memory settings for Initial memory pool, 
> maximum memory pool size and thread stack size when the fields are 
> blank when you use the "Configure Tomcat" interface on Windows. I was 
> wondering if changing one or more of these settings would help ?

The default depends upon the JVM and the OS.

> We are running Tomcat 6.0.26 on Windows Server 2008 R2 standard and 
> JVM version is 1.6.0_20-b02

Best way to find out for sure[1] is:

C:\> java -XX:+PrintFlagsFinal -version 2>&1 | findstr HeapSize

The two settings you are looking for are MaxHeapSize and InitialHeapSize. Those 
values are in bytes, so you'll probably have to divide by 1024 a couple of 
times to get at the "real" value in human-readable terms.

The best way to find the default permgen size is:

C:\> java -XX:+PrintFlagsFinal -version 2>&1  | findstr PermSize

Hope that helps,
- -chris

[1]
http://stackoverflow.com/questions/2915276/what-is-the-default-maximum-h
eap-size-for-suns-jvm-from-java-se-6
-BEGIN PGP SIGNATURE-
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBCAAGBQJYCPN3AAoJEBzwKT+lPKRYCXEQAK3AKioa7kRPTvs24yj+1vq6
SFo20WtjFhBrqyhSRdcvcwUjoDAIS6d6wqjDQ13v919jFRTsqCrDh9FQg1MeCWVB
UJVmcV33XjTQUmqEY03YUPwOVjgQe6RJM+FJAE60werkHEEirg85gL/WamQ+QtfW
C39sp2NO6kHpD7VWnBKPhToNmcy7lz2EK6Ye8aEXkn2mk2PZhJFRysgTqeJ/CChA
KnUzWAqrDBM3OtHerivHuIEHhJB7+43bD9kiX7JZXDlcVkubAz6bep3m2sXO3T9O
VYZs0ACKvnzuc6kqkStMcsGUeLWvYc5+xhCDNcxGhYXjrIWOaW5aS9QipZmAXze7
IoY2UC4vxyajRNuFmLeUWaeICDtYZaf/5d3wrlsbCIWF/vf2C+NpuynEidq6N6Yv
pFvTqRd+ZsNEbsKaQwaHSHsfQVxtQbPlFfUlYWvu7vz+Y5xCyTSFoct2UqDcBedi
Bo+vdHVoih/i9+4Zhg+Bieh5lygcoE9VS0KX2yu+4kwaaSohFoxwHcHXoD1SjXTU
FDq2H+GXV/3bS/hAek+5WzQuPJC5etsqcMUfIc

Re: java.lang.OutOfMemoryError: PermGen space

2016-10-20 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Jon,

On 10/20/16 6:00 AM, Moore, Jon, Vodafone UK wrote:
> I have a problem where our customers application server stops
> working intermittently and when we check the Tomcat logs we get the
> message " java.lang.OutOfMemoryError: PermGen space" but the Tomcat
> service is still running, and we have to restart the Tomcat
> service. I am a complete novice when it comes to Tomcat but am
> expected to resolve this issue as this server is part of the Avaya
> telephony solution.
> 
> I have 2 questions please.
> 
> 1 - What would be causing this.

Are you also a Java novice as well? No judgement... I just want to
adjust my level of snark appropriately :)

Java has a special heap space called the "permanent generation" (a
term which becomes less descriptive as time goes on) but basically all
java.lang.Class objects loaded by the JVM go there. The more libraries
and other stuff that gets loaded, the more space in permgen is used.
The defaults for the size of permgen are often fairly small, and you
may have to raise them. This is especially true for applications that
use large frameworks like Spring.

Raising the permgen space is almost always the right decision under
normal circumstances when you get an OOME:permgen error. I would
double whatever its current value is and monitor the application for a
while to see if that improves things.

The only situation I know of where raising the permgen size is not the
right move is when there is a "classloader-pinning leak". That happens
when you hot-deploy an application many times, but the old versions of
the application are not undeploying cleanly. This situation is quite
the rabbit-hole, so I'll stop there unless you can confirm that you do
hot-deployments without restarting Tomcat and the JVM.

If you instead get OOME for other reasons, it's frequently NOT the
right decision to increase the heap size because it usually indicates
that there is a memory leak in the application and giving it more heap
just means you'll wait longer between failures. Instead, the
application should be fixed to not leak memory :)

> 2 - What are the default Java memory settings for Initial memory 
> pool, maximum memory pool size and thread stack size when the
> fields are blank when you use the "Configure Tomcat" interface on
> Windows. I was wondering if changing one or more of these settings
> would help ?

The default depends upon the JVM and the OS.

> We are running Tomcat 6.0.26 on Windows Server 2008 R2 standard
> and JVM version is 1.6.0_20-b02

Best way to find out for sure[1] is:

C:\> java -XX:+PrintFlagsFinal -version 2>&1 | findstr HeapSize

The two settings you are looking for are MaxHeapSize and
InitialHeapSize. Those values are in bytes, so you'll probably have to
divide by 1024 a couple of times to get at the "real" value in
human-readable terms.

The best way to find the default permgen size is:

C:\> java -XX:+PrintFlagsFinal -version 2>&1  | findstr PermSize

Hope that helps,
- -chris

[1]
http://stackoverflow.com/questions/2915276/what-is-the-default-maximum-h
eap-size-for-suns-jvm-from-java-se-6
-BEGIN PGP SIGNATURE-
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBCAAGBQJYCPN3AAoJEBzwKT+lPKRYCXEQAK3AKioa7kRPTvs24yj+1vq6
SFo20WtjFhBrqyhSRdcvcwUjoDAIS6d6wqjDQ13v919jFRTsqCrDh9FQg1MeCWVB
UJVmcV33XjTQUmqEY03YUPwOVjgQe6RJM+FJAE60werkHEEirg85gL/WamQ+QtfW
C39sp2NO6kHpD7VWnBKPhToNmcy7lz2EK6Ye8aEXkn2mk2PZhJFRysgTqeJ/CChA
KnUzWAqrDBM3OtHerivHuIEHhJB7+43bD9kiX7JZXDlcVkubAz6bep3m2sXO3T9O
VYZs0ACKvnzuc6kqkStMcsGUeLWvYc5+xhCDNcxGhYXjrIWOaW5aS9QipZmAXze7
IoY2UC4vxyajRNuFmLeUWaeICDtYZaf/5d3wrlsbCIWF/vf2C+NpuynEidq6N6Yv
pFvTqRd+ZsNEbsKaQwaHSHsfQVxtQbPlFfUlYWvu7vz+Y5xCyTSFoct2UqDcBedi
Bo+vdHVoih/i9+4Zhg+Bieh5lygcoE9VS0KX2yu+4kwaaSohFoxwHcHXoD1SjXTU
FDq2H+GXV/3bS/hAek+5WzQuPJC5etsqcMUfIcf8YjrDmR6BabEvQFk5p9APYV+x
7lcODhWFlF3tEOvKiIRmPuQz/d4/hR5ETo6h12g2UMsfY9ogEZF7I8SP1uNK3bpO
cH97Lssd2MS5qj/Kd/m5
=JBc2
-END PGP SIGNATURE-

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



Re: java.lang.OutOfMemoryError: PermGen space

2016-10-20 Thread tomcat

On 20.10.2016 12:00, Moore, Jon, Vodafone UK wrote:

I have a problem where our customers application server stops working intermittently and 
when we check the Tomcat logs we get the message " java.lang.OutOfMemoryError: 
PermGen space" but the Tomcat service is still running, and we have to restart the 
Tomcat service. I am a complete novice when it comes to Tomcat but am expected to resolve 
this issue as this server is part of the Avaya telephony solution.

I have 2 questions please.

1 - What would be causing this.

2 - What are the default Java memory settings for Initial memory pool, maximum memory 
pool size and thread stack size when the fields are blank when you use the 
"Configure Tomcat" interface on Windows. I was wondering if changing one or 
more of these settings would help ?

We are running Tomcat 6.0.26 on Windows Server 2008 R2 standard and JVM version 
is 1.6.0_20-b02



Not a real answer to your question, but one important aspect as a start : these "default 
settings" are the settings of the JVM, not of Tomcat. There are no parameters in Tomcat 
itself which control those; Tomcat just "lives" in the JVM that runs it.


At a second level : these default settings (and the non-default ones), vary according to 
the JVM which you are using, its version, the host it is running on etc.
So you need to look up the values and parameters in the configuration documentation of the 
JVM vendor (e.g. Oracle, IBM, ..), not on the Tomcat site.


As for your question # 1 :
this would be a good start : http://lmgtfy.com/?q=java+permgen+space

Another answer would be : your application
(Note: I'm not kidding; it really depends on your applications.  Tomcat itself runs 
happily with the default JVM settings)






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



Re: java.lang.OutOfMemoryError: PermGen space

2016-10-20 Thread Román Valoria
1. Bad memory settings or a java class having a memory leak.

2. The place to setup the values will depend if you run Tomcat as a Windows
Service, from the tomcat7.exe or from the startup.bat.

BTW, those are super outdated releases of OS, Java and Tomcat.

On Thu, Oct 20, 2016 at 6:00 PM, Moore, Jon, Vodafone UK <
jon.mo...@vodafone.com> wrote:

> I have a problem where our customers application server stops working
> intermittently and when we check the Tomcat logs we get the message "
> java.lang.OutOfMemoryError: PermGen space" but the Tomcat service is still
> running, and we have to restart the Tomcat service. I am a complete novice
> when it comes to Tomcat but am expected to resolve this issue as this
> server is part of the Avaya telephony solution.
>
> I have 2 questions please.
>
> 1 - What would be causing this.
>
> 2 - What are the default Java memory settings for Initial memory pool,
> maximum memory pool size and thread stack size when the fields are blank
> when you use the "Configure Tomcat" interface on Windows. I was wondering
> if changing one or more of these settings would help ?
>
> We are running Tomcat 6.0.26 on Windows Server 2008 R2 standard and JVM
> version is 1.6.0_20-b02
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>


RE: java.lang.OutOfMemoryError: PermGen space

2010-07-16 Thread Caldarale, Charles R
 From: Mehrotra, Anurag [mailto:amehro...@telebright.com]
 Subject: java.lang.OutOfMemoryError: PermGen space
 
 Off lately I have been running into PermGenSpace Out 
 of memory errors.

Are you reloading any webapps?  Have you looked inside the heap to see what 
classes are consuming the PermGen space?  Have you read the FAQ entry on the 
subject?

http://wiki.apache.org/tomcat/FAQ/Memory

 -XX:NewSize=512m -XX:MaxNewSize=512m

I'd remove the above two settings, just on general principles.  No point in 
tying one hand of the garbage collector behind its back.

You might want to add -XX:+HeapDumpOnOutOfMemoryError so you can look at it 
with jhat or similar tools.

http://download.oracle.com/docs/cd/E17409_01/javase/6/docs/technotes/tools/share/jhat.html

 - 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.lang.OutOfMemoryError: PermGen space

2009-09-16 Thread Caldarale, Charles R
 From: Bruce Wayne [mailto:chur...@gmail.com]
 Subject: java.lang.OutOfMemoryError: PermGen space
 
 I keep getting the following error:
 java.lang.OutOfMemoryError: PermGen space

1) Use JConsole or equivalent to verify that you are actually using 1G of 
PermGen.

2) Turn on -verbose:class just to see what's getting loaded.

3) Turn on -verbose:gc to watch things grow; if there's a sudden jump in 
PermGen usage, that may be the culprit.

4) Any chance that .jsp timestamps are in the future, resulting in continual 
compilation?

5) Use a heap profiler to see what's eating up the space and preventing classes 
from being garbage collected.

 - 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.lang.OutOfMemoryError: PermGen space

2009-09-16 Thread Jeffrey Janner
Bruce -
You don't say if the JVM is 32-bit or 64-bit, but assuming the latter:
1) By splitting the Heap in half between NewGen and PermGen, you are
leaving no room for OldGen, and I'm sure java is going to want to set
aside some space for OldGen.  So you are probably getting the error
because there is no room for the PermGen you requested.
2) According to Sun: Since 1.4, MaxNewSize is computed as a function of
NewRatio. [1.3.1 Sparc: 32m; 1.3.1 x86: 2.5m.] With a default ratio of
8 or 12 (depends), you are probably losing a lot to the OldGen.
3) Also according to Sun, I am seeing this note on most memory options:
5.0 and newer: 64 bit VMs are scaled 30% larger
Here's the link I found useful:
http://java.sun.com/javase/technologies/hotspot/vmoptions.jsp
Jeff


-Original Message-
From: Bruce Wayne [mailto:chur...@gmail.com] 
Sent: Wednesday, September 16, 2009 6:49 AM
To: users@tomcat.apache.org
Subject: java.lang.OutOfMemoryError: PermGen space

Hello,

I am running Red Hat Linux 2.6.18-164.el5 #1 SMP  x86_64 x86_64 x86_64
GNU/Linux with Tomcat 6 as seen below:

# /opt/tomcat/bin/version.sh
Using CATALINA_BASE:   /opt/tomcat
Using CATALINA_HOME:   /opt/tomcat
Using CATALINA_TMPDIR: /opt/tomcat/temp
Using JRE_HOME:   /usr/java/jdk1.6.0_16
Server version: Apache Tomcat/6.0.20
Server built:   May 14 2009 01:13:50
Server number:  6.0.20.0
OS Name:Linux
OS Version: 2.6.18-164.el5
Architecture:   amd64
JVM Version:1.6.0_16-b01
JVM Vendor: Sun Microsystems Inc.

My JAVA_OPTS are:
JAVA_OPTS=$JAVA_OPTS -Djava.awt.headless=true -Dfile.encoding=UTF-8
-server
-Xms2048m -Xmx2048m -XX:NewSize=1024m -XX:MaxNewSize=1024m
-XX:PermSize=1024m -XX:MaxPermSize=1024m -XX:+DisableExplicitGC

My system has 6GB of RAM.

I keep getting the following error:

java.lang.OutOfMemoryError: PermGen space
java.lang.ClassLoader.defineClass1(Native Method)
java.lang.ClassLoader.defineClass(ClassLoader.java:621)


java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
java.net.URLClassLoader.access$000(URLClassLoader.java:56)
java.net.URLClassLoader$1.run(URLClassLoader.java:195)

java.security.AccessController.doPrivileged(Native Method)
java.net.URLClassLoader.findClass(URLClassLoader.java:188)
java.lang.ClassLoader.loadClass(ClassLoader.java:307)
java.lang.ClassLoader.loadClass(ClassLoader.java:252)

java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)

org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment.init(Lookup
Environment.java:87)

org.eclipse.jdt.internal.compiler.Compiler.init(Compiler.java:261)


org.eclipse.jdt.internal.compiler.Compiler.init(Compiler.java:153)

org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:42
3)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:334)

org.apache.jasper.compiler.Compiler.compile(Compiler.java:312)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:299)

org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.ja
va:586)

org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.ja
va:317)


org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)

org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)


Any help would be appreciated!

Thanks!

***  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: java.lang.OutOfMemoryError: PermGen space

2009-09-16 Thread Caldarale, Charles R
 From: Jeffrey Janner [mailto:jeffrey.jan...@polydyne.com]
 Subject: RE: java.lang.OutOfMemoryError: PermGen space
 
 You don't say if the JVM is 32-bit or 64-bit

Actually, he did:

 Architecture:   amd64
 JVM Version:1.6.0_16-b01
 JVM Vendor: Sun Microsystems Inc.

The architecture would be x86 for a 32-bit JVM on Intel/AMD.

 1) By splitting the Heap in half between NewGen and PermGen

This is not correct.  The -Xmx size does not include the PermGen size.

Again, use JConsole or equivalent to verify that the requested heap sizes are 
being used.

 - 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.lang.OutOfMemoryError: PermGen space

2009-09-16 Thread Jeffrey Janner
Charles -
My other post didn't make it back yet.
Now I'm getting confused, because the same doc I referenced below, which
treats Heap and PermGen separately in Appendix B, says this in Chapter
3:
The detail message PermGen space indicates that the permanent
generation is full. The permanent generation is the area of the heap
where class and method objects are stored. If an application loads a
very large number of classes, then the size of the permanent generation
might need to be increased using the -XX:MaxPermSize option.
http://java.sun.com/javase/6/webnotes/trouble/TSG-VM/html/memleaks.html
That is specifically about the error Bruce is seeing.
But, yes, it appears he's loading too many classes, or reloading them,
or something.
Something else Bruce can look into is if his apps are using common jar
files that can be loaded into Shared space.
Jeff

-Original Message-
From: Jeffrey Janner [mailto:jeffrey.jan...@polydyne.com] 
Sent: Wednesday, September 16, 2009 9:31 AM
To: Tomcat Users List
Subject: RE: java.lang.OutOfMemoryError: PermGen space

Chuck -
I couldn't tell from the post if the Architecture line meant hardware,
OS, or JVM.  And I'm under the impression from multiple re-reads of the
Java tuning docs that ALL generations are drawn from the heap, including
PermGen.
Yes, using Jconsole or better is what he needs to do.

Bruce-
Here is another good read.  Direct from Sun:
http://java.sun.com/javase/6/webnotes/trouble/TSG-VM/html/tools.html
Jeff


-Original Message-
From: Caldarale, Charles R [mailto:chuck.caldar...@unisys.com] 
Sent: Wednesday, September 16, 2009 9:04 AM
To: Tomcat Users List
Subject: RE: java.lang.OutOfMemoryError: PermGen space

 From: Jeffrey Janner [mailto:jeffrey.jan...@polydyne.com]
 Subject: RE: java.lang.OutOfMemoryError: PermGen space
 
 You don't say if the JVM is 32-bit or 64-bit

Actually, he did:

 Architecture:   amd64
 JVM Version:1.6.0_16-b01
 JVM Vendor: Sun Microsystems Inc.

The architecture would be x86 for a 32-bit JVM on Intel/AMD.

 1) By splitting the Heap in half between NewGen and PermGen

This is not correct.  The -Xmx size does not include the PermGen size.

Again, use JConsole or equivalent to verify that the requested heap
sizes are being used.

 - 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: java.lang.OutOfMemoryError: PermGen space

2009-09-16 Thread Jeffrey Janner
Charles -
Of course, a quick review of the doc I provided, proved me wrong on the
Heap/PermGen issue.
I admit not having re-read the memory tuning guide in a while (maybe
since 1.4 days).
Jeff

-Original Message-
From: Jeffrey Janner [mailto:jeffrey.jan...@polydyne.com] 
Sent: Wednesday, September 16, 2009 9:31 AM
To: Tomcat Users List
Subject: RE: java.lang.OutOfMemoryError: PermGen space

Chuck -
I couldn't tell from the post if the Architecture line meant hardware,
OS, or JVM.  And I'm under the impression from multiple re-reads of the
Java tuning docs that ALL generations are drawn from the heap, including
PermGen.
Yes, using Jconsole or better is what he needs to do.

Bruce-
Here is another good read.  Direct from Sun:
http://java.sun.com/javase/6/webnotes/trouble/TSG-VM/html/tools.html
Jeff


-Original Message-
From: Caldarale, Charles R [mailto:chuck.caldar...@unisys.com] 
Sent: Wednesday, September 16, 2009 9:04 AM
To: Tomcat Users List
Subject: RE: java.lang.OutOfMemoryError: PermGen space

 From: Jeffrey Janner [mailto:jeffrey.jan...@polydyne.com]
 Subject: RE: java.lang.OutOfMemoryError: PermGen space
 
 You don't say if the JVM is 32-bit or 64-bit

Actually, he did:

 Architecture:   amd64
 JVM Version:1.6.0_16-b01
 JVM Vendor: Sun Microsystems Inc.

The architecture would be x86 for a 32-bit JVM on Intel/AMD.

 1) By splitting the Heap in half between NewGen and PermGen

This is not correct.  The -Xmx size does not include the PermGen size.

Again, use JConsole or equivalent to verify that the requested heap
sizes are being used.

 - 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: java.lang.OutOfMemoryError: PermGen space

2009-09-16 Thread Caldarale, Charles R
 From: Jeffrey Janner [mailto:jeffrey.jan...@polydyne.com]
 Subject: RE: java.lang.OutOfMemoryError: PermGen space
 
 I couldn't tell from the post if the Architecture line meant hardware,
 OS, or JVM.

A little experimentation will show that the value is dependent on the mode of 
the JVM, despite the fact that the corresponding system property name is 
os.arch.

 And I'm under the impression from multiple re-reads of the
 Java tuning docs that ALL generations are drawn from the heap,
 including PermGen.

Nope.

 - 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.lang.OutOfMemoryError: PermGen space

2009-09-16 Thread Caldarale, Charles R
 From: Jeffrey Janner [mailto:jeffrey.jan...@polydyne.com]
 Subject: RE: java.lang.OutOfMemoryError: PermGen space
 
 Something else Bruce can look into is if his apps are using common jar
 files that can be loaded into Shared space.

That's almost always a bad idea, since it usually makes reloading of individual 
webapps impossible, and introduces massive version dependency complications 
when updating libraries.

 - 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.lang.OutOfMemoryError: PermGen space

2009-09-16 Thread Bruce Wayne
What's too many classes ? I have JConsole running, and I see that across
my 8 apps on one server, 14,000 classes are loaded. Heap usage is around
1GB.With the settings below, I am not seeing PermGen errors as of yet,
although it's too early to tell, I will have to let the app run for 24
hours.
JAVA_OPTS=$JAVA_OPTS -Djava.awt.headless=true -Dfile.encoding=UTF-8 -server
-Xms1024m -Xmx3012m -XX:NewSize=512m -XX:MaxNewSize=1024m -XX:PermSize=512m
-XX:MaxPermSize=1024m


On Wed, Sep 16, 2009 at 10:44 AM, Jeffrey Janner 
jeffrey.jan...@polydyne.com wrote:

 Charles -
 My other post didn't make it back yet.
 Now I'm getting confused, because the same doc I referenced below, which
 treats Heap and PermGen separately in Appendix B, says this in Chapter
 3:
 The detail message PermGen space indicates that the permanent
 generation is full. The permanent generation is the area of the heap
 where class and method objects are stored. If an application loads a
 very large number of classes, then the size of the permanent generation
 might need to be increased using the -XX:MaxPermSize option.
 http://java.sun.com/javase/6/webnotes/trouble/TSG-VM/html/memleaks.html
 That is specifically about the error Bruce is seeing.
 But, yes, it appears he's loading too many classes, or reloading them,
 or something.
 Something else Bruce can look into is if his apps are using common jar
 files that can be loaded into Shared space.
 Jeff

 -Original Message-
 From: Jeffrey Janner [mailto:jeffrey.jan...@polydyne.com]
 Sent: Wednesday, September 16, 2009 9:31 AM
 To: Tomcat Users List
 Subject: RE: java.lang.OutOfMemoryError: PermGen space

 Chuck -
 I couldn't tell from the post if the Architecture line meant hardware,
 OS, or JVM.  And I'm under the impression from multiple re-reads of the
 Java tuning docs that ALL generations are drawn from the heap, including
 PermGen.
 Yes, using Jconsole or better is what he needs to do.

 Bruce-
 Here is another good read.  Direct from Sun:
 http://java.sun.com/javase/6/webnotes/trouble/TSG-VM/html/tools.html
 Jeff


 -Original Message-
 From: Caldarale, Charles R [mailto:chuck.caldar...@unisys.com]
 Sent: Wednesday, September 16, 2009 9:04 AM
 To: Tomcat Users List
 Subject: RE: java.lang.OutOfMemoryError: PermGen space

  From: Jeffrey Janner [mailto:jeffrey.jan...@polydyne.com]
  Subject: RE: java.lang.OutOfMemoryError: PermGen space
 
  You don't say if the JVM is 32-bit or 64-bit

 Actually, he did:

  Architecture:   amd64
  JVM Version:1.6.0_16-b01
  JVM Vendor: Sun Microsystems Inc.

 The architecture would be x86 for a 32-bit JVM on Intel/AMD.

  1) By splitting the Heap in half between NewGen and PermGen

 This is not correct.  The -Xmx size does not include the PermGen size.

 Again, use JConsole or equivalent to verify that the requested heap
 sizes are being used.

  - 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

RE: java.lang.OutOfMemoryError: PermGen space

2009-09-16 Thread Jeffrey Janner
See my other posts, I did re-read the tuning guide and it specifically
states PermGen is part of Heap.

-Original Message-
From: Jeffrey Janner [mailto:jeffrey.jan...@polydyne.com] 
Sent: Wednesday, September 16, 2009 9:34 AM
To: Tomcat Users List
Subject: RE: java.lang.OutOfMemoryError: PermGen space

Charles -
Of course, a quick review of the doc I provided, proved me wrong on the
Heap/PermGen issue.
I admit not having re-read the memory tuning guide in a while (maybe
since 1.4 days).
Jeff

-Original Message-
From: Jeffrey Janner [mailto:jeffrey.jan...@polydyne.com] 
Sent: Wednesday, September 16, 2009 9:31 AM
To: Tomcat Users List
Subject: RE: java.lang.OutOfMemoryError: PermGen space

Chuck -
I couldn't tell from the post if the Architecture line meant hardware,
OS, or JVM.  And I'm under the impression from multiple re-reads of the
Java tuning docs that ALL generations are drawn from the heap, including
PermGen.
Yes, using Jconsole or better is what he needs to do.

Bruce-
Here is another good read.  Direct from Sun:
http://java.sun.com/javase/6/webnotes/trouble/TSG-VM/html/tools.html
Jeff


-Original Message-
From: Caldarale, Charles R [mailto:chuck.caldar...@unisys.com] 
Sent: Wednesday, September 16, 2009 9:04 AM
To: Tomcat Users List
Subject: RE: java.lang.OutOfMemoryError: PermGen space

 From: Jeffrey Janner [mailto:jeffrey.jan...@polydyne.com]
 Subject: RE: java.lang.OutOfMemoryError: PermGen space
 
 You don't say if the JVM is 32-bit or 64-bit

Actually, he did:

 Architecture:   amd64
 JVM Version:1.6.0_16-b01
 JVM Vendor: Sun Microsystems Inc.

The architecture would be x86 for a 32-bit JVM on Intel/AMD.

 1) By splitting the Heap in half between NewGen and PermGen

This is not correct.  The -Xmx size does not include the PermGen size.

Again, use JConsole or equivalent to verify that the requested heap
sizes are being used.

 - 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



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

RE: java.lang.OutOfMemoryError: PermGen space

2009-09-16 Thread Caldarale, Charles R
 From: Jeffrey Janner [mailto:jeffrey.jan...@polydyne.com]
 Subject: RE: java.lang.OutOfMemoryError: PermGen space
 
 See my other posts, I did re-read the tuning guide and it specifically
 states PermGen is part of Heap.

The total heap (NewGen + OldGen + PermGen) is allocated in one contiguous chunk 
of virtual space, which can be a problem when fitting it all in on a 32-bit 
process.  However, the -Xmx is just for NewGen + OldGen; the PermGen size 
remains independent.  This has been true since HotSpot was first available.  
Prior to HotSpot, instances of java.lang.Class were allocated from the general 
Java heap, not segregated.

 - 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.lang.OutOfMemoryError: PermGen space

2009-09-16 Thread Jeffrey Janner
Here's another Sun doc that specifically states that PermGen is an area
of the Heap.
http://java.sun.com/j2se/reference/whitepapers/memorymanagement_whitepap
er.pdf
Scroll down to page 17.
But for my own assurance, I'll crank up JConsole on one of my known
configurations and check for myself.
Jeff

-Original Message-
From: Caldarale, Charles R [mailto:chuck.caldar...@unisys.com] 
Sent: Wednesday, September 16, 2009 9:51 AM
To: Tomcat Users List
Subject: RE: java.lang.OutOfMemoryError: PermGen space

 From: Jeffrey Janner [mailto:jeffrey.jan...@polydyne.com]
 Subject: RE: java.lang.OutOfMemoryError: PermGen space
 
 I couldn't tell from the post if the Architecture line meant hardware,
 OS, or JVM.

A little experimentation will show that the value is dependent on the
mode of the JVM, despite the fact that the corresponding system property
name is os.arch.

 And I'm under the impression from multiple re-reads of the
 Java tuning docs that ALL generations are drawn from the heap,
 including PermGen.

Nope.

 - 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: java.lang.OutOfMemoryError: PermGen space

2009-09-16 Thread Caldarale, Charles R
 From: Bruce Wayne [mailto:chur...@gmail.com]
 Subject: Re: java.lang.OutOfMemoryError: PermGen space
 
 What's too many classes ?

More than will fit in PermGen.

 Heap usage is around 1GB.

You need to be more specific; post the sizes for each portion of the heap, 
including PermGen.  Also, which GC algorithms are being used?  You'll find them 
on the VM Summary tab.

 -Xms1024m -Xmx3012m

Generally better in a server environment to set -Xms and -Xmx to the same 
value; avoids pointless heap resizing.  Nothing to do with your PermGen 
problem, however.

 -XX:NewSize=512m -XX:MaxNewSize=1024m

Why are you setting these explicitly?  Let the JVM do it, so it can adjust them 
appropriately for the characteristics of the webapps.

- 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.lang.OutOfMemoryError: PermGen space

2009-09-16 Thread Caldarale, Charles R
 From: Jeffrey Janner [mailto:jeffrey.jan...@polydyne.com]
 Subject: RE: java.lang.OutOfMemoryError: PermGen space
 
 Here's another Sun doc that specifically states that PermGen is an area
 of the Heap.

Paper != code.  PermGen is logically part of the overall heap, but its size is 
not included in -Xmx.

Note in the JConsole memory display that PermGen is part of the non-heap 
category.

 - 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.lang.OutOfMemoryError: PermGen space

2009-09-16 Thread Jeffrey Janner
Yep, keep monitoring them. Watch the size of PermGen over time.  It will
grow as new methods and classes are called.

I was kinda specifically referring to my own situation (too may
classes), where I had the same app loaded into multiple instances each
with their own copies of the dependant 3rd-party libraries.  It appeared
each app loaded its own version of the library into PermGen, and at some
point (about 6-8 instances) I started seeing the PermGen errors.
Increasing the size only delayed the issue.  I ended up moving most of
the libs to the shared directory.  That worked for me, mostly, because
it's the same app, just different instances.  I have the ability to
upgrade all the instances in lock-step, so it works.  It is not a
solution for everybody.  (only had a problem with Log4j, and I'm
guessing that was a config issue in the profiles.)

I stated before, I don't think the MaxNewSize option is available
anymore. You should be using NewRatio instead.

Charles, please correct me if my assumption in paragraph 2, sentence 2
was incorrect.
Jeff


-Original Message-
From: Bruce Wayne [mailto:chur...@gmail.com] 
Sent: Wednesday, September 16, 2009 9:58 AM
To: Tomcat Users List
Subject: Re: java.lang.OutOfMemoryError: PermGen space

What's too many classes ? I have JConsole running, and I see that
across
my 8 apps on one server, 14,000 classes are loaded. Heap usage is around
1GB.With the settings below, I am not seeing PermGen errors as of yet,
although it's too early to tell, I will have to let the app run for 24
hours.
JAVA_OPTS=$JAVA_OPTS -Djava.awt.headless=true -Dfile.encoding=UTF-8
-server
-Xms1024m -Xmx3012m -XX:NewSize=512m -XX:MaxNewSize=1024m
-XX:PermSize=512m
-XX:MaxPermSize=1024m


On Wed, Sep 16, 2009 at 10:44 AM, Jeffrey Janner 
jeffrey.jan...@polydyne.com wrote:

 Charles -
 My other post didn't make it back yet.
 Now I'm getting confused, because the same doc I referenced below,
which
 treats Heap and PermGen separately in Appendix B, says this in Chapter
 3:
 The detail message PermGen space indicates that the permanent
 generation is full. The permanent generation is the area of the heap
 where class and method objects are stored. If an application loads a
 very large number of classes, then the size of the permanent
generation
 might need to be increased using the -XX:MaxPermSize option.

http://java.sun.com/javase/6/webnotes/trouble/TSG-VM/html/memleaks.html
 That is specifically about the error Bruce is seeing.
 But, yes, it appears he's loading too many classes, or reloading them,
 or something.
 Something else Bruce can look into is if his apps are using common jar
 files that can be loaded into Shared space.
 Jeff

 -Original Message-
 From: Jeffrey Janner [mailto:jeffrey.jan...@polydyne.com]
 Sent: Wednesday, September 16, 2009 9:31 AM
 To: Tomcat Users List
 Subject: RE: java.lang.OutOfMemoryError: PermGen space

 Chuck -
 I couldn't tell from the post if the Architecture line meant hardware,
 OS, or JVM.  And I'm under the impression from multiple re-reads of
the
 Java tuning docs that ALL generations are drawn from the heap,
including
 PermGen.
 Yes, using Jconsole or better is what he needs to do.

 Bruce-
 Here is another good read.  Direct from Sun:
 http://java.sun.com/javase/6/webnotes/trouble/TSG-VM/html/tools.html
 Jeff


 -Original Message-
 From: Caldarale, Charles R [mailto:chuck.caldar...@unisys.com]
 Sent: Wednesday, September 16, 2009 9:04 AM
 To: Tomcat Users List
 Subject: RE: java.lang.OutOfMemoryError: PermGen space

  From: Jeffrey Janner [mailto:jeffrey.jan...@polydyne.com]
  Subject: RE: java.lang.OutOfMemoryError: PermGen space
 
  You don't say if the JVM is 32-bit or 64-bit

 Actually, he did:

  Architecture:   amd64
  JVM Version:1.6.0_16-b01
  JVM Vendor: Sun Microsystems Inc.

 The architecture would be x86 for a 32-bit JVM on Intel/AMD.

  1) By splitting the Heap in half between NewGen and PermGen

 This is not correct.  The -Xmx size does not include the PermGen size.

 Again, use JConsole or equivalent to verify that the requested heap
 sizes are being used.

  - 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

RE: java.lang.OutOfMemoryError: PermGen space

2009-09-16 Thread Jeffrey Janner
OK, thanks for clearing that up.  Wish Sun was as clear.
That does explain why I had issues with 32-bit Windows. (not my 1st OS
choice)


-Original Message-
From: Caldarale, Charles R [mailto:chuck.caldar...@unisys.com] 
Sent: Wednesday, September 16, 2009 10:06 AM
To: Tomcat Users List
Subject: RE: java.lang.OutOfMemoryError: PermGen space

 From: Jeffrey Janner [mailto:jeffrey.jan...@polydyne.com]
 Subject: RE: java.lang.OutOfMemoryError: PermGen space
 
 See my other posts, I did re-read the tuning guide and it specifically
 states PermGen is part of Heap.

The total heap (NewGen + OldGen + PermGen) is allocated in one
contiguous chunk of virtual space, which can be a problem when fitting
it all in on a 32-bit process.  However, the -Xmx is just for NewGen +
OldGen; the PermGen size remains independent.  This has been true since
HotSpot was first available.  Prior to HotSpot, instances of
java.lang.Class were allocated from the general Java heap, not
segregated.

 - 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: java.lang.OutOfMemoryError: PermGen space

2009-09-16 Thread Caldarale, Charles R
 From: Jeffrey Janner [mailto:jeffrey.jan...@polydyne.com]
 Subject: RE: java.lang.OutOfMemoryError: PermGen space
 
 It appeared each app loaded its own version of the library
 into PermGen

That is correct, since each webapp has its own classloader.

 I stated before, I don't think the MaxNewSize option is available
 anymore. You should be using NewRatio instead.

MaxNewSize is still functional in 1.6; haven't looked in 1.7.

 - 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.lang.OutOfMemoryError: PermGen space

2009-09-16 Thread Jeffrey Janner
That's why I said he could look into it.
Didn't say it was the best, just if he could.
It works great for me, but I've got better control over the apps then
most folks, probably.

-Original Message-
From: Caldarale, Charles R [mailto:chuck.caldar...@unisys.com] 
Sent: Wednesday, September 16, 2009 9:54 AM
To: Tomcat Users List
Subject: RE: java.lang.OutOfMemoryError: PermGen space

 From: Jeffrey Janner [mailto:jeffrey.jan...@polydyne.com]
 Subject: RE: java.lang.OutOfMemoryError: PermGen space
 
 Something else Bruce can look into is if his apps are using common jar
 files that can be loaded into Shared space.

That's almost always a bad idea, since it usually makes reloading of
individual webapps impossible, and introduces massive version dependency
complications when updating libraries.

 - 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: java.lang.OutOfMemoryError: PermGen space

2009-09-16 Thread Jeffrey Janner
 I stated before, I don't think the MaxNewSize option is available
 anymore. You should be using NewRatio instead.

MaxNewSize is still functional in 1.6; haven't looked in 1.7.

Chuck, what good does it do to set this value?
Is it any better than setting NewRatio?

***  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: java.lang.OutOfMemoryError: PermGen space

2009-09-16 Thread Caldarale, Charles R
 From: Jeffrey Janner [mailto:jeffrey.jan...@polydyne.com]
 Subject: RE: java.lang.OutOfMemoryError: PermGen space
 
 what good does it do to set this value?

Unless I've got extremely predictable behavior from my webapps that never 
varies with time, load, phase of the moon, or whatever, I wouldn't try to 
control any of the internal heap sizings.  The current GC algorithms adapt 
pretty well to the usage patterns.

 Is it any better than setting NewRatio?

NewRatio is more flexible when the heap size varies or is explicitly changed; I 
believe they're essentially equivalent if the same value is always used for 
-Xms and -Xmx.

 - 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.lang.OutOfMemoryError: PermGen space

2008-06-12 Thread Caldarale, Charles R
 From: Shashidhar Rampally [mailto:[EMAIL PROTECTED]
 Subject: java.lang.OutOfMemoryError: PermGen space

 I need to increase the heap space by adding -Xms128m -Xmx512m
 to either JAVA_OPTS or CATALINA_OPTS environment variable

That won't help if you're running out of PermGen space.

 In my installation I do not have a catalina.bat file at all!

For some inexplicable reason, the .exe distribution does not include the 
scripts, but the .zip one does.  Regardless, since you're running Tomcat as a 
service, you can adjust the heap sizes and other JVM parameters with the 
tomcat5w.exe program.

Here's a posting from earlier today about the same problem:

This is a common problem, so reading the FAQ:
   http://wiki.apache.org/tomcat/FAQ/Memory
is always a good idea, as would searching the archives:
   http://marc.info/?l=tomcat-user

You may have a memory leak in your applications that's leaving class references 
lying around, preventing them from being discarded via garbage collection.  
Alternatively, if you really are running out of PermGen space, you'll have to 
increase it, which of course takes away from the real memory available for the 
rest of the heap.

 - 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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: java.lang.OutOfMemoryError: PermGen space

2008-06-12 Thread Shashidhar Rampally
Thanks for the quick reply Chuck! I found java5w.exe immediately after
I sent the email. Increasing the heap did not solve my issue. I had to
increase the PermSize by setting -XX:MaxPermSize=256m

Now I am getting some IO and RMI exceptions. However, they are all
related to Alfrsco.

Thanks again!
Thanks,
Shashi

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



Re: java.lang.OutOfMemoryError: PermGen space

2007-11-16 Thread Edward Dowgiallo
I'm getting this error on a development server as we constantly
redeploy the same app for testing.  The problem does not occur until
after several dozen redeployments.  This makes sense since each
redeployment contains new versions of some of the application's
classes.

Ed

On 11/16/07, Peter Crowther [EMAIL PROTECTED] wrote:
  From: loredana loredana [mailto:[EMAIL PROTECTED]
  I'm having some problems figuring out what webapp is causing
  this problem.

 It's not simple!  However, the main use for PermGen is storage for classes.
 Do you have any webapps that dynamically generate classes?  Is it happening
 when you redeploy a webapp, or randomly on a production server?

 - Peter

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



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



Re: java.lang.OutOfMemoryError: PermGen space

2007-11-16 Thread Martin Gainty
2 options will help Xerces consume less memory
1)turn OFF validation for any Documents created from the
DocumentBuilderFactory e.g.
factory.setValidating(false);

2)turn OFF namespace awareness for any Documents created from the
DocumentBuilderFactory e.g.
factory.setNamespaceAware(false);

More info available at
http://mia.ece.uic.edu/~papers/WWW/MultimediaStandards/Parsers.pdf

M-

- Original Message -
From: loredana loredana [EMAIL PROTECTED]
To: users@tomcat.apache.org
Sent: Friday, November 16, 2007 9:11 AM
Subject: java.lang.OutOfMemoryError: PermGen space


 I'm having some problems figuring out what webapp is causing this problem.
I figure the cause of this is the fact that garbage collector does not clean
up and memory allocated for java object generation is used . Right now i
have a hunch on one of the webapps:
 I have an application which connects every 5 minutes to an url, opens a
stream and reads some data(about 20 lines from an xml file) appends that
text to a local file, draws a chart based on that data and creates some html
files. The xml files where the text is appended can get to a max of 30 kb at
the end of the day. That's not that much. But still, could something like
this cause the PermGen space error? 10x







 Never miss a thing.  Make Yahoo your home page.
 http://www.yahoo.com/r/hs


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




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



Re: java.lang.OutOfMemoryError: PermGen space

2007-11-16 Thread loredana loredana
I don't dynamically generate classes . however I do redeploy my webapps quite 
often. But I do that using the classic tomcat restart. so I don't know if that 
could cause it. I also use a caching system (Ehcache) but I use it to cache 
html files that change their content often. I will look into the xerces 
solution. 10x

- Original Message 
From: Martin Gainty [EMAIL PROTECTED]
To: Tomcat Users List users@tomcat.apache.org
Sent: Friday, November 16, 2007 4:53:42 PM
Subject: Re: java.lang.OutOfMemoryError: PermGen space


2 options will help Xerces consume less memory
1)turn OFF validation for any Documents created from the
DocumentBuilderFactory e.g.
factory.setValidating(false);

2)turn OFF namespace awareness for any Documents created from the
DocumentBuilderFactory e.g.
factory.setNamespaceAware(false);

More info available at
http://mia.ece.uic.edu/~papers/WWW/MultimediaStandards/Parsers.pdf

M-

- Original Message -
From: loredana loredana [EMAIL PROTECTED]
To: users@tomcat.apache.org
Sent: Friday, November 16, 2007 9:11 AM
Subject: java.lang.OutOfMemoryError: PermGen space


 I'm having some problems figuring out what webapp is causing this
 problem.
I figure the cause of this is the fact that garbage collector does not
 clean
up and memory allocated for java object generation is used . Right now
 i
have a hunch on one of the webapps:
 I have an application which connects every 5 minutes to an url, opens
 a
stream and reads some data(about 20 lines from an xml file) appends
 that
text to a local file, draws a chart based on that data and creates some
 html
files. The xml files where the text is appended can get to a max of 30
 kb at
the end of the day. That's not that much. But still, could something
 like
this cause the PermGen space error? 10x







 Never miss a thing.  Make Yahoo your home page.
 http://www.yahoo.com/r/hs


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




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






  

Be a better pen pal. 
Text or chat with friends inside Yahoo! Mail. See how.  
http://overview.mail.yahoo.com/


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



RE: java.lang.OutOfMemoryError: PermGen space

2007-11-16 Thread Peter Crowther
 From: loredana loredana [mailto:[EMAIL PROTECTED]
 I'm having some problems figuring out what webapp is causing
 this problem.

It's not simple!  However, the main use for PermGen is storage for classes.  Do 
you have any webapps that dynamically generate classes?  Is it happening when 
you redeploy a webapp, or randomly on a production server?

- Peter

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



Re: java.lang.OutOfMemoryError: PermGen space

2007-11-16 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Ed,

Edward Dowgiallo wrote:
 I'm getting this error on a development server as we constantly
 redeploy the same app for testing.  The problem does not occur until
 after several dozen redeployments.  This makes sense since each
 redeployment contains new versions of some of the application's
 classes.

Note that each redeployment contains new versions of /all/ of your
application's classes.

Class identity = fully-qualified class name + class loader

- -chris

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

iD8DBQFHPhOD9CaO5/Lv0PARAmnAAJ4oRCUQYA2TgISLyyD3oi0rZAmLUACeLZ18
pKcv6Cp6o8se/iNkK29Fv8k=
=PHHn
-END PGP SIGNATURE-

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



RE: java.lang.OutOfMemoryError: PermGen space .

2007-02-21 Thread Peter Crowther
 From: Muruganantham [mailto:[EMAIL PROTECTED] 
 *java.lang.OutOfMemoryError: PermGen space* .

http://tomcat.apache.org/faq/memory.html - search for MaxPermSize.

- Peter

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



Re: java.lang.OutOfMemoryError: PermGen space .

2007-02-21 Thread Mohan Wickramasinghe
try setting in JVM paramerter
MaxPermSize=256m
(if using linux)


 hi,

 I am using RHEL 4 and Tomcat. I have restarted my tomcat.

 After restarting my Tomcat server i am getting the following error while i
 try to view some jsp pages


 *java.lang.OutOfMemoryError: PermGen space* .


 Please any one help me.


 Thanks,

 M.Muruganantham.


 --
 Regards,

 M.Muruganantham.
 CheapChess Development Team,
 Silicon Oyster Technologies,
 Chennai-84.
 www.sot.in



Regards
Mohan Wickramasinghe


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



Re: java.lang.OutOfMemoryError: PermGen space

2006-06-06 Thread Ingo Rockel

Hi,

Your Permanent Generation is running out of memory, this is a special 
space in the vm memory, where the vm stores all of its internal data 
(classes, etc.). You should pass -XX:+PrintGCDetails to the VM to see 
how much perm-space is used. If you have a lot of third-party-libraries 
etc. your permanent space might be to small, adjust using:


-XX:MaxPermSize=newvalue

see here for options:

http://java.sun.com/docs/hotspot/VMOptions.html

regards,

Ingo

Peter Neu schrieb:

Hello,

 


I have many memory consuming apps on my tomcat server. I a lot pdf  excel
generation. So every other week I get this error

 


 java.lang.OutOfMemoryError: PermGen space

 


I know the root of this error is that the garbage collector does not clean
up and memory allocated 


for java object generation is used up. But what can I do about it? If I
allocate more memory I'm only postponing

the problem. So do I have to shutdown every day my tomcat server to ensure
the deletion of unused objects or

Will only a tomcat cluster help in this case? I also read the archives but
could not find any useful explenation.

 


I defined max memory usage for 2 Gig with the Catalina_Opts variable in my
start script. CATALINA_OPTS=-Xmx2048m -Xms1536m

 


Tomcat 5.5.9

Java 1.5.0_04-b05

SuSE Linux ES 9

 


Cheers,

 


Pete

 

 

 

 


SCHWERWIEGEND: Servlet.service() for servlet jsp threw exception

java.lang.OutOfMemoryError: PermGen space

Exception in thread TP-Processor10 java.lang.OutOfMemoryError: PermGen
space

Exception in thread TP-Processor11 Exception in thread TP-Processor1
java.lang.OutOfMemoryError: PermGen space

java.lang.OutOfMemoryError: PermGen space

Exception in thread TP-Processor7 java.lang.OutOfMemoryError: PermGen
space

Exception in thread TP-Processor6 java.lang.OutOfMemoryError: PermGen
space

Exception in thread TP-Processor2 java.lang.OutOfMemoryError: PermGen
space

Exception in thread TP-Processor12 java.lang.OutOfMemoryError: PermGen
space

Exception in thread TP-Processor5 java.lang.OutOfMemoryError: PermGen
space

Exception in thread TP-Processor9 java.lang.OutOfMemoryError: PermGen
space

Exception in thread TP-Processor16 java.lang.OutOfMemoryError: PermGen
space

Exception in thread TP-Processor15 java.lang.OutOfMemoryError: PermGen
space

Exception in thread TP-Processor14 java.lang.OutOfMemoryError: PermGen
space

Exception in thread TP-Processor13 java.lang.OutOfMemoryError: PermGen
space

Exception in thread TP-Processor20 java.lang.OutOfMemoryError: PermGen
space

Exception in thread TP-Processor18 Exception in thread TP-Processor19
java.lang.OutOfMemoryError: PermGen space

java.lang.OutOfMemoryError: PermGen space

Exception in thread TP-Processor17 java.lang.OutOfMemoryError: PermGen
space

Exception in thread TP-Processor24 java.lang.OutOfMemoryError: PermGen
space

Exception in thread TP-Processor23 java.lang.OutOfMemoryError: PermGen
space

Exception in thread TP-Processor22 java.lang.OutOfMemoryError: PermGen
space

Exception in thread TP-Processor21 java.lang.OutOfMemoryError: PermGen
space

Exception in thread TP-Processor28 java.lang.OutOfMemoryError: PermGen
space

Exception in thread TP-Processor27 java.lang.OutOfMemoryError: PermGen
space

Exception in thread TP-Processor26 java.lang.OutOfMemoryError: PermGen
space

Exception in thread TP-Processor25 java.lang.OutOfMemoryError: PermGen
space

Exception in thread TP-Processor32 java.lang.OutOfMemoryError: PermGen
space

Exception in thread TP-Processor30 Exception in thread TP-Processor29
Exception in thread TP-Processor31 java.lang.OutOfMemoryError: PermGen
space

java.lang.OutOfMemoryError: PermGen space

java.lang.OutOfMemoryError: PermGen space

Exception in thread TP-Processor36 java.lang.OutOfMemoryError: PermGen
space

Exception in thread TP-Processor35 java.lang.OutOfMemoryError: PermGen
space

Exception in thread TP-Processor34 java.lang.OutOfMemoryError: PermGen
space

Exception in thread TP-Processor33 java.lang.OutOfMemoryError: PermGen
space

Exception in thread TP-Processor39 Exception in thread TP-Processor37
java.lang.OutOfMemoryError: PermGen space

Exception in thread TP-Processor40 java.lang.OutOfMemoryError: PermGen
space

Exception in thread TP-Processor38 java.lang.OutOfMemoryError: PermGen
space

java.lang.OutOfMemoryError: PermGen space

Exception in thread TP-Processor44 java.lang.OutOfMemoryError: PermGen
space

Exception in thread TP-Processor43 java.lang.OutOfMemoryError: PermGen
space

Exception in thread TP-Processor41 Exception in thread TP-Processor48
java.lang.OutOfMemoryError: PermGen space

java.lang.OutOfMemoryError: PermGen space

Exception in thread TP-Processor42 java.lang.OutOfMemoryError: PermGen
space

Exception in thread TP-Processor46 java.lang.OutOfMemoryError: PermGen
space

Exception in thread TP-Processor47 java.lang.OutOfMemoryError: PermGen
space

Exception in thread TP-Processor45 java.lang.OutOfMemoryError: PermGen
space

Exception in thread 

Re: java.lang.OutOfMemoryError: PermGen space

2006-06-06 Thread William Bonnet
Hi

 I have many memory consuming apps on my tomcat server. I a lot pdf  excel
 generation. So every other week I get this error



  java.lang.OutOfMemoryError: PermGen space

Try to add more space for PermGen using

-XX:MaxPermSize=256m

I think default is 64 megs

Kind regards,

-- 
William Bonnet

SunWizard - Le site francais dédié aux amateurs de stations Unix
http://www.sunwizard.net

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



Re: java.lang.OutOfMemoryError: PermGen space

2006-06-06 Thread Christian Reichlin

hi,

if you have a lot of different webapps with the same third party libs in 
the WEB-INF/lib folder it might help if you move them to the shared/lib 
folder. i recommend to put only the third party libs there, who are 
definitely the same for all webapps, for example jdbc-driver and similar 
things.


this helps because otherwise they are all loaded by a different 
classloader so they all need for each webapp some permGen space.


does it needs some redeploys of webapps till the memory exception 
ocures? in this case the class loader of the undeployed webapp can't be 
garbage collected and all the classdefinitions remain in memory for 
ever... or until tomcat is restarted.


regards
chris

Ingo Rockel wrote:


Hi,

Your Permanent Generation is running out of memory, this is a special 
space in the vm memory, where the vm stores all of its internal data 
(classes, etc.). You should pass -XX:+PrintGCDetails to the VM to see 
how much perm-space is used. If you have a lot of 
third-party-libraries etc. your permanent space might be to small, 
adjust using:


-XX:MaxPermSize=newvalue

see here for options:

http://java.sun.com/docs/hotspot/VMOptions.html

regards,

Ingo

Peter Neu schrieb:


Hello,

 

I have many memory consuming apps on my tomcat server. I a lot pdf  
excel

generation. So every other week I get this error

 


 java.lang.OutOfMemoryError: PermGen space

 

I know the root of this error is that the garbage collector does not 
clean

up and memory allocated
for java object generation is used up. But what can I do about it? If I
allocate more memory I'm only postponing

the problem. So do I have to shutdown every day my tomcat server to 
ensure

the deletion of unused objects or

Will only a tomcat cluster help in this case? I also read the 
archives but

could not find any useful explenation.

 

I defined max memory usage for 2 Gig with the Catalina_Opts variable 
in my

start script. CATALINA_OPTS=-Xmx2048m -Xms1536m

 


Tomcat 5.5.9

Java 1.5.0_04-b05

SuSE Linux ES 9

 


Cheers,

 


Pete

 

 

 

 


SCHWERWIEGEND: Servlet.service() for servlet jsp threw exception

java.lang.OutOfMemoryError: PermGen space

Exception in thread TP-Processor10 java.lang.OutOfMemoryError: PermGen
space

Exception in thread TP-Processor11 Exception in thread TP-Processor1
java.lang.OutOfMemoryError: PermGen space

java.lang.OutOfMemoryError: PermGen space

Exception in thread TP-Processor7 java.lang.OutOfMemoryError: PermGen
space

Exception in thread TP-Processor6 java.lang.OutOfMemoryError: PermGen
space

Exception in thread TP-Processor2 java.lang.OutOfMemoryError: PermGen
space

Exception in thread TP-Processor12 java.lang.OutOfMemoryError: PermGen
space

Exception in thread TP-Processor5 java.lang.OutOfMemoryError: PermGen
space

Exception in thread TP-Processor9 java.lang.OutOfMemoryError: PermGen
space

Exception in thread TP-Processor16 java.lang.OutOfMemoryError: PermGen
space

Exception in thread TP-Processor15 java.lang.OutOfMemoryError: PermGen
space

Exception in thread TP-Processor14 java.lang.OutOfMemoryError: PermGen
space

Exception in thread TP-Processor13 java.lang.OutOfMemoryError: PermGen
space

Exception in thread TP-Processor20 java.lang.OutOfMemoryError: PermGen
space

Exception in thread TP-Processor18 Exception in thread 
TP-Processor19

java.lang.OutOfMemoryError: PermGen space

java.lang.OutOfMemoryError: PermGen space

Exception in thread TP-Processor17 java.lang.OutOfMemoryError: PermGen
space

Exception in thread TP-Processor24 java.lang.OutOfMemoryError: PermGen
space

Exception in thread TP-Processor23 java.lang.OutOfMemoryError: PermGen
space

Exception in thread TP-Processor22 java.lang.OutOfMemoryError: PermGen
space

Exception in thread TP-Processor21 java.lang.OutOfMemoryError: PermGen
space

Exception in thread TP-Processor28 java.lang.OutOfMemoryError: PermGen
space

Exception in thread TP-Processor27 java.lang.OutOfMemoryError: PermGen
space

Exception in thread TP-Processor26 java.lang.OutOfMemoryError: PermGen
space

Exception in thread TP-Processor25 java.lang.OutOfMemoryError: PermGen
space

Exception in thread TP-Processor32 java.lang.OutOfMemoryError: PermGen
space

Exception in thread TP-Processor30 Exception in thread 
TP-Processor29

Exception in thread TP-Processor31 java.lang.OutOfMemoryError: PermGen
space

java.lang.OutOfMemoryError: PermGen space

java.lang.OutOfMemoryError: PermGen space

Exception in thread TP-Processor36 java.lang.OutOfMemoryError: PermGen
space

Exception in thread TP-Processor35 java.lang.OutOfMemoryError: PermGen
space

Exception in thread TP-Processor34 java.lang.OutOfMemoryError: PermGen
space

Exception in thread TP-Processor33 java.lang.OutOfMemoryError: PermGen
space

Exception in thread TP-Processor39 Exception in thread 
TP-Processor37

java.lang.OutOfMemoryError: PermGen space

Exception in thread TP-Processor40 java.lang.OutOfMemoryError: PermGen
space

Exception in thread TP-Processor38 

Re: java.lang.OutOfMemoryError: PermGen space

2006-06-06 Thread Antonio Petrelli

Peter Neu ha scritto:

Hello,

 


I have many memory consuming apps on my tomcat server. I a lot pdf  excel
generation. So every other week I get this error

 


 java.lang.OutOfMemoryError: PermGen space

  


http://wiki.apache.org/tomcat/OutOfMemory
HTH
Antonio

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



Re: java.lang.OutOfMemoryError: PermGen space

2005-12-28 Thread Rodrigo Ruiz
I guess it does not. Such an action should be considered a responsibility of
the web application.

Anyway, you could suggest this in the Tomcat bug list as a new feature.
Surely, it will not hurt ;-D

Regards,
Rodrigo Ruiz

On 12/23/05, Durfee, Bernard [EMAIL PROTECTED] wrote:

 Does Tomcat call releaseAll() when a web-app is undeployed?

 Bernie




Re: java.lang.OutOfMemoryError: PermGen space

2005-12-23 Thread Stephen Caine

Chuck,


For starters, I'd try -verbose:gc and perhaps -verbose:class to  
give you a general idea of what's happening when.  There are many  
flavors of profilers out there, a lot of them free.  (Our customers  
tend to go for the premium stuff like Wily Introscope, which  
definitely isn't free, but has lots of bells and whistles - and  
support.)


Thank you and Wade for your suggestions.  I have some reading to do.

Stephen Caine
CommonGround Softworks, Inc.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: java.lang.OutOfMemoryError: PermGen space

2005-12-23 Thread Durfee, Bernard
Does Tomcat call releaseAll() when a web-app is undeployed?

Bernie

 - It is very common to find a declaration like this:
 
 private static final Log log = LogFactory.getLog(MyClass.class);
 
   From the commons-logging API documentation:
 
   LogFactory needs to keep a static map of LogFactory 
 objects keyed by 
 context classloader; when the webapp is undeployed this 
 means there is 
 still a reference to the undeployed classloader preventing the memory 
 used by all its classes from being reclaimed.
 
 If you are using commons-logging, the LogFactory provides the 
 releaseAll method, that can be used to release all the internal 
 references, and can also be called from the 
 ServletContextListener.contextDestroyed() method. In fact, the 
 commons-logging documentation itself recommends to use this method in 
 servlet containers ;-) You can also use the 
 org.apache.commons.logging.impl.ServletContextCleaner class.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: java.lang.OutOfMemoryError: PermGen space

2005-12-22 Thread Warren Lewis
You probably will need to update the setting of -XX:MaxPermSize= 
I believe the default value is 64m.

cheers - Warren 

-Original Message-
From: Mike Dippold [mailto:[EMAIL PROTECTED] 
Sent: Thursday, December 22, 2005 1:57 PM
To: users@tomcat.apache.org
Subject: java.lang.OutOfMemoryError: PermGen space 

We are using tomcat 5.5.12 and every couple days the tomcat server goes down 
hard and the last line in the log is: 

java.lang.OutOfMemoryError: PermGen space 

It appears to only happen if we: 
Update jsp pages
Reload Webapp
Deploy Webapp 

If we do not do any of the following the server runs great with no problems 
which makes me wonder if it has to do with our application or tomcat.  We are 
planning on restarting tomcat each night for now, but we do not want to do that 
if we shouldnt have to. 

Please Advise. 

Thanks,
Mike 
 
   

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: java.lang.OutOfMemoryError: PermGen space

2005-12-22 Thread Mike Dippold
Wont that just give me more time between having to restart?  Is it normal to 
have permgen space fill up and never get it back?


-- Original Message --
From: Warren Lewis [EMAIL PROTECTED]
Date:  Thu, 22 Dec 2005 14:07:40 -0500

You probably will need to update the setting of -XX:MaxPermSize= 
I believe the default value is 64m.

cheers - Warren 

-Original Message-
From: Mike Dippold [mailto:[EMAIL PROTECTED] 
Sent: Thursday, December 22, 2005 1:57 PM
To: users@tomcat.apache.org
Subject: java.lang.OutOfMemoryError: PermGen space 

We are using tomcat 5.5.12 and every couple days the tomcat server goes down 
hard and the last line in the log is: 

java.lang.OutOfMemoryError: PermGen space 

It appears to only happen if we: 
Update jsp pages
Reload Webapp
Deploy Webapp 

If we do not do any of the following the server runs great with no problems 
which makes me wonder if it has to do with our application or tomcat.  We are 
planning on restarting tomcat each night for now, but we do not want to do 
that if we shouldnt have to. 

Please Advise. 

Thanks,
Mike 
 
   

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


 
   

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: java.lang.OutOfMemoryError: PermGen space

2005-12-22 Thread Durfee, Bernard
I've seen the same thing with 5.5.12 running Confluence and JIRA. I
needed to bounce Tomcat after making a bunch of changes to the JIRA
workflow, which triggered lot's of processing. I assumed it was a JIRA
problem, but maybe it is related to Tomcat 5.5.12? I haven't had the
problem since, that was a few days ago.

Bernie



 -Original Message-
 From: Mike Dippold [mailto:[EMAIL PROTECTED] 
 Sent: Thursday, December 22, 2005 1:57 PM
 To: users@tomcat.apache.org
 Subject: java.lang.OutOfMemoryError: PermGen space
 
 
 We are using tomcat 5.5.12 and every couple days the tomcat 
 server goes down hard and the last line in the log is: 
 
 java.lang.OutOfMemoryError: PermGen space 
 
 It appears to only happen if we: 
 Update jsp pages 
 Reload Webapp 
 Deploy Webapp 
 
 If we do not do any of the following the server runs great 
 with no problems which makes me wonder if it has to do with 
 our application or tomcat.  We are planning on restarting 
 tomcat each night for now, but we do not want to do that if 
 we shouldnt have to. 
 
 Please Advise. 
 
 Thanks, 
 Mike 
  

 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: java.lang.OutOfMemoryError: PermGen space

2005-12-22 Thread Carl Olivier
Greetings.

AFAIK PermGenSpace is not TC related - its within the JVM and is where
permanent memory related loads go - which includes classes loaded by
ClassLoaders.

Additionally - AFAIK this PermGenSpace does NOT get cleared by the Garbage
collector - and only a restart of the JVM will rid you of that used space.

The default size of the pgs is 64mb I believe - to increase this you need to
use the following JVM runtime switch:

-XX:MaxPermSize=96m

Where 96 is the max size in mb (as indicated by the m! :P).

Hope that helps,

Rgds,

Carl

-Original Message-
From: Durfee, Bernard [mailto:[EMAIL PROTECTED] 
Sent: 22 December 2005 20:25
To: Tomcat Users List
Subject: RE: java.lang.OutOfMemoryError: PermGen space

I've seen the same thing with 5.5.12 running Confluence and JIRA. I needed
to bounce Tomcat after making a bunch of changes to the JIRA workflow, which
triggered lot's of processing. I assumed it was a JIRA problem, but maybe it
is related to Tomcat 5.5.12? I haven't had the problem since, that was a few
days ago.

Bernie



 -Original Message-
 From: Mike Dippold [mailto:[EMAIL PROTECTED]
 Sent: Thursday, December 22, 2005 1:57 PM
 To: users@tomcat.apache.org
 Subject: java.lang.OutOfMemoryError: PermGen space
 
 
 We are using tomcat 5.5.12 and every couple days the tomcat server 
 goes down hard and the last line in the log is:
 
 java.lang.OutOfMemoryError: PermGen space
 
 It appears to only happen if we: 
 Update jsp pages
 Reload Webapp
 Deploy Webapp
 
 If we do not do any of the following the server runs great with no 
 problems which makes me wonder if it has to do with our application or 
 tomcat.  We are planning on restarting tomcat each night for now, but 
 we do not want to do that if we shouldnt have to.
 
 Please Advise. 
 
 Thanks,
 Mike
  

 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: java.lang.OutOfMemoryError: PermGen space

2005-12-22 Thread Caldarale, Charles R
 From: Carl Olivier [mailto:[EMAIL PROTECTED] 
 Subject: RE: java.lang.OutOfMemoryError: PermGen space
 
 Additionally - AFAIK this PermGenSpace does NOT get cleared 
 by the Garbage collector - and only a restart of the JVM will
 rid you of that used space.

Not really true.  A full GC does clean out any unused classes from perm
space.  As I recall, the usual problem is that certain framework
mechanisms hang onto references to classes, thereby preventing them from
being GC'd.  Check the mail archives, since this topic seems to pop up
about once a month.  I believe there were even some fixes provided.

 - 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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: java.lang.OutOfMemoryError: PermGen space

2005-12-22 Thread Stephen Caine

Mike,

We are using tomcat 5.5.12 and every couple days the tomcat server  
goes down hard and the last line in the log is:


java.lang.OutOfMemoryError: PermGen space

It appears to only happen if we:
Update jsp pages
Reload Webapp
Deploy Webapp

If we do not do any of the following the server runs great with no  
problems which makes me wonder if it has to do with our application  
or tomcat.  We are planning on restarting tomcat each night for  
now, but we do not want to do that if we shouldnt have to.


This is exactly the problem we kept experiencing, only ours was after  
4 -5 hours of heavy use.  We have a very large webapp with well over  
200 complex pages.  However, we were able to address this by using  
the following configuration:


-server -Xms2048m -Xmx2048m -XX:MaxPermSize=128m -XX:NewRatio=16

We have 3 gigabytes of RAM, but were were still getting out of memory  
errors.  The key setting, -XX:NewRatio=16 was the trick.  This is  
the ratio allocation between 'perm' and 'eden' memory.  The default  
value is 8.  Raising this value gives more memory to the perm  
memory.  Also note, that raising the MaxPermSize to 128m helped for a  
while, but eventually we got an out of memory error.


We have struggled with correct allocations and continue to tweak our  
settings.  I  hope this is helpful.


Stephen Caine
CommonGround Softworks, Inc.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: java.lang.OutOfMemoryError: PermGen space

2005-12-22 Thread Stephen Caine

Chuck,

I can only speculate that reducing the size of the NewGen area (due  
to the larger value of NewRatio) forced more frequent collections  
of recently allocated objects, thereby eliminating some class  
object references.  Without knowing a lot more about your  
applications and doing some detailed measurement, that has to be  
taken with a large chunk of salt.


Thank you for your thoughts.  I am using a Quad 4 Mac OS X with a  
1.4.2 JVM.  Any recommendations for testing tools so I can monitor  
memory allocations, garbage collection and the like?


Stephen Caine
CommonGround Softworks, Inc.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: java.lang.OutOfMemoryError: PermGen space

2005-12-22 Thread Caldarale, Charles R
 From: Stephen Caine [mailto:[EMAIL PROTECTED] 
 Subject: Re: java.lang.OutOfMemoryError: PermGen space 
 
 Thank you for your thoughts.  I am using a Quad 4 Mac OS X with a  
 1.4.2 JVM.  Any recommendations for testing tools so I can monitor  
 memory allocations, garbage collection and the like?

For starters, I'd try -verbose:gc and perhaps -verbose:class to give you
a general idea of what's happening when.  There are many flavors of
profilers out there, a lot of them free.  (Our customers tend to go for
the premium stuff like Wily Introscope, which definitely isn't free, but
has lots of bells and whistles - and support.)

I'd also suggest searching the mailing list archives, since this problem
with running out of PermGen space comes up fairly often.  There have
been some techniques and tips posted to help reduce the impact.  My
archive preference is here:
http://marc.theaimsgroup.com/?l=tomcat-userr=1w=2

 - 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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]