You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by xu cheng <xc...@gmail.com> on 2010/11/22 03:22:06 UTC

OutOfMemoryError some time on some tomcat!!!!1

hi:
 I've wrote an app with jsp and servlet, and I used four libs

commons.logging
common.httpclient
jdom
commons.codec

the app works pretty well on my pc, and the tomcat is apache-tomcat-6.0.29
however , when I put this app on to another computer with the same tomcat
it throws this exception
Java HotSpot(TM) 64-Bit Server VM warning: Exception
java.lang.OutOfMemoryError occurred dispatching signal SIGTERM to
handler- the VM may need to be forcibly terminated
it seems the exception of the jvm rather the tomcat.

and some times like this
Deploying web application archive XXX.war
Exception in thread "http-8080-24" java.lang.OutOfMemoryError: PermGen space
Exception in thread "http-8080-14" java.lang.OutOfMemoryError: PermGen space
Exception in thread "http-8080-2" java.lang.OutOfMemoryError: PermGen space


and the memory is absolutely enough
maybe it's my app's fault, but I cannot find it..


does anyone have had this kind of problem?
or any suggestions ?
thanks

Re: OutOfMemoryError some time on some tomcat!!!!1

Posted by Sylvain Laurent <sy...@m4x.org>.
Don't bother with jhat, try eclipse Memory Analysis Tool instead. It's much more friendly and efficient to find leaks.


On 23 nov. 2010, at 12:18, xu cheng wrote:

> hi, Chuck.Caldarale
> I referenced to these two links
> http://blogs.sun.com/fkieviet/entry/classloader_leaks_the_dreaded_java
> http://blogs.sun.com/fkieviet/entry/how_to_fix_the_dreaded
> and do as the blog tolds, but failed to find the reason of the oom of my
> app...
> thanks though..
> 
> by the way, do you have the the jhat the articals mentioned? I went to the
> jdk/bin,
> but the jhat there seems not work as the author mentioned.


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


Re: OutOfMemoryError some time on some tomcat!!!!1

Posted by Daniel Baktiar <db...@gmail.com>.
hi xu,

if you cannot find the "jhat" in the bin folder, most probably you were
referring to jre folder, instead of jdk folder.
i just checked it out, my jdk/bin folder has it, but not the case for my
jre/bin folder.

daniel
---
daniel baktiar
http://savinggaia.tritiumapps.com - saving the planet is everyone's
business!




On 23 November 2010 19:18, xu cheng <xc...@gmail.com> wrote:

>  hi, Chuck.Caldarale
> I referenced to these two links
> http://blogs.sun.com/fkieviet/entry/classloader_leaks_the_dreaded_java
> http://blogs.sun.com/fkieviet/entry/how_to_fix_the_dreaded
> and do as the blog tolds, but failed to find the reason of the oom of my
> app...
> thanks though..
>
> by the way, do you have the the jhat the articals mentioned? I went to the
> jdk/bin,
> but the jhat there seems not work as the author mentioned.
>
>
>
>
> 2010/11/23 Daniel Baktiar <db...@gmail.com>
>
> > hi charles,
> >
> > please allow me to disagree to that "hanging onto reference" as the main
> > issue.
> >
> > permgen space is garbage collector's specific issue, not general "hanging
> > onto reference issue". it is caused by redeployment, which is the
> metadata
> > for classes, marked to be permanent generation by the hotspot garbage
> > collector. when you deploy new classes, the class loader will introduce
> > memory usages that will also marked as permanent generation.
> >
> > permgen is oracle hotspot specific implementation issue. you won't get it
> > when you run on oracle jrockit (which performs just in time compilation),
> > for example.
> > ---
> > daniel baktiar
> > http://savinggaia.tritiumapps.com - saving the planet is everyone's
> > business!
> >
> >
> >
> >
> > On 23 November 2010 14:10, Caldarale, Charles R
> > <Ch...@unisys.com>wrote:
> >
> > > > From: xu cheng [mailto:xcheng.222@gmail.com]
> > > > Subject: Re: OutOfMemoryError some time on some tomcat!!!!1
> > >
> > > > I just kept redeploying apps , and the perm gen keep
> > > > growing each time I deploy the same app. and when I
> > > > undeploy the app, the perm gen didn't clean the garbage
> > >
> > > Exactly the situation I suggested the other day: you have something
> > that's
> > > hanging onto a reference to an object from your webapp classes,
> > preventing
> > > the old webapp deployment from being garbage collected.  Again, read
> > this:
> > >
> > > http://wiki.apache.org/tomcat/FAQ/Memory
> > >
> > > Also, take a look at these:
> > >
> > > http://blogs.sun.com/fkieviet/entry/classloader_leaks_the_dreaded_java
> > > http://blogs.sun.com/fkieviet/entry/how_to_fix_the_dreaded
> > >
> > >  - Chuck
> > >
> > >
> > > THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE
> PROPRIETARY
> > > MATERIAL and is thus for use only by the intended recipient. If you
> > received
> > > this in error, please contact the sender and delete the e-mail and its
> > > attachments from all computers.
> > >
> > >
> >
>

Re: OutOfMemoryError some time on some tomcat!!!!1

Posted by xu cheng <xc...@gmail.com>.
 hi, Chuck.Caldarale
I referenced to these two links
http://blogs.sun.com/fkieviet/entry/classloader_leaks_the_dreaded_java
http://blogs.sun.com/fkieviet/entry/how_to_fix_the_dreaded
and do as the blog tolds, but failed to find the reason of the oom of my
app...
thanks though..

by the way, do you have the the jhat the articals mentioned? I went to the
jdk/bin,
but the jhat there seems not work as the author mentioned.




2010/11/23 Daniel Baktiar <db...@gmail.com>

> hi charles,
>
> please allow me to disagree to that "hanging onto reference" as the main
> issue.
>
> permgen space is garbage collector's specific issue, not general "hanging
> onto reference issue". it is caused by redeployment, which is the metadata
> for classes, marked to be permanent generation by the hotspot garbage
> collector. when you deploy new classes, the class loader will introduce
> memory usages that will also marked as permanent generation.
>
> permgen is oracle hotspot specific implementation issue. you won't get it
> when you run on oracle jrockit (which performs just in time compilation),
> for example.
> ---
> daniel baktiar
> http://savinggaia.tritiumapps.com - saving the planet is everyone's
> business!
>
>
>
>
> On 23 November 2010 14:10, Caldarale, Charles R
> <Ch...@unisys.com>wrote:
>
> > > From: xu cheng [mailto:xcheng.222@gmail.com]
> > > Subject: Re: OutOfMemoryError some time on some tomcat!!!!1
> >
> > > I just kept redeploying apps , and the perm gen keep
> > > growing each time I deploy the same app. and when I
> > > undeploy the app, the perm gen didn't clean the garbage
> >
> > Exactly the situation I suggested the other day: you have something
> that's
> > hanging onto a reference to an object from your webapp classes,
> preventing
> > the old webapp deployment from being garbage collected.  Again, read
> this:
> >
> > http://wiki.apache.org/tomcat/FAQ/Memory
> >
> > Also, take a look at these:
> >
> > http://blogs.sun.com/fkieviet/entry/classloader_leaks_the_dreaded_java
> > http://blogs.sun.com/fkieviet/entry/how_to_fix_the_dreaded
> >
> >  - Chuck
> >
> >
> > THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
> > MATERIAL and is thus for use only by the intended recipient. If you
> received
> > this in error, please contact the sender and delete the e-mail and its
> > attachments from all computers.
> >
> >
>

Re: OutOfMemoryError some time on some tomcat

Posted by Daniel Baktiar <db...@gmail.com>.
hi mark,

thank you for showing my mistake. my apology to chuck also.
i will read the article.

---
daniel baktiar
http://savinggaia.tritiumapps.com - saving the planet is everyone's
business!




On 23 November 2010 18:50, Mark Thomas <ma...@apache.org> wrote:

> On 23/11/2010 06:55, Daniel Baktiar wrote:
> > hi charles,
> >
> > please allow me to disagree to that "hanging onto reference" as the main
> > issue.
>
> Daniel,
>
> You are completely wrong. I suggest you read this:
> http://wiki.apache.org/tomcat/MemoryLeakProtection
> and try out some of the sample code with a profiler.
>
> > permgen space is garbage collector's specific issue, not general "hanging
> > onto reference issue". it is caused by redeployment, which is the
> metadata
> > for classes, marked to be permanent generation by the hotspot garbage
> > collector. when you deploy new classes, the class loader will introduce
> > memory usages that will also marked as permanent generation.
>
> That might have been true with the JVMs of 10 years ago. It certainly
> isn't true today and hasn't been for quite some time.
>
> Unused classes can be GC'd from permgen. If you don't believe me, get
> yourself a profiler and test it for yourself.
>
> > permgen is oracle hotspot specific implementation issue. you won't get it
> > when you run on oracle jrockit (which performs just in time compilation),
> > for example.
>
> Yes you will see the exact same problem in JRockit. However, it will
> take a lot longer since JRockit stores class information in the Java
> heap. That means you still have a memory leak but it takes a lot longer
> for it to trigger an OOME since you have to fill the entire heap first
> rather than 'just' filling permgen.
>
> Mark
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

Re: OutOfMemoryError some time on some tomcat

Posted by Mark Thomas <ma...@apache.org>.
On 23/11/2010 06:55, Daniel Baktiar wrote:
> hi charles,
> 
> please allow me to disagree to that "hanging onto reference" as the main
> issue.

Daniel,

You are completely wrong. I suggest you read this:
http://wiki.apache.org/tomcat/MemoryLeakProtection
and try out some of the sample code with a profiler.

> permgen space is garbage collector's specific issue, not general "hanging
> onto reference issue". it is caused by redeployment, which is the metadata
> for classes, marked to be permanent generation by the hotspot garbage
> collector. when you deploy new classes, the class loader will introduce
> memory usages that will also marked as permanent generation.

That might have been true with the JVMs of 10 years ago. It certainly
isn't true today and hasn't been for quite some time.

Unused classes can be GC'd from permgen. If you don't believe me, get
yourself a profiler and test it for yourself.

> permgen is oracle hotspot specific implementation issue. you won't get it
> when you run on oracle jrockit (which performs just in time compilation),
> for example.

Yes you will see the exact same problem in JRockit. However, it will
take a lot longer since JRockit stores class information in the Java
heap. That means you still have a memory leak but it takes a lot longer
for it to trigger an OOME since you have to fill the entire heap first
rather than 'just' filling permgen.

Mark

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


Re: OutOfMemoryError some time on some tomcat!!!!1

Posted by Daniel Baktiar <db...@gmail.com>.
hi charles,

please allow me to disagree to that "hanging onto reference" as the main
issue.

permgen space is garbage collector's specific issue, not general "hanging
onto reference issue". it is caused by redeployment, which is the metadata
for classes, marked to be permanent generation by the hotspot garbage
collector. when you deploy new classes, the class loader will introduce
memory usages that will also marked as permanent generation.

permgen is oracle hotspot specific implementation issue. you won't get it
when you run on oracle jrockit (which performs just in time compilation),
for example.
---
daniel baktiar
http://savinggaia.tritiumapps.com - saving the planet is everyone's
business!




On 23 November 2010 14:10, Caldarale, Charles R
<Ch...@unisys.com>wrote:

> > From: xu cheng [mailto:xcheng.222@gmail.com]
> > Subject: Re: OutOfMemoryError some time on some tomcat!!!!1
>
> > I just kept redeploying apps , and the perm gen keep
> > growing each time I deploy the same app. and when I
> > undeploy the app, the perm gen didn't clean the garbage
>
> Exactly the situation I suggested the other day: you have something that's
> hanging onto a reference to an object from your webapp classes, preventing
> the old webapp deployment from being garbage collected.  Again, read this:
>
> http://wiki.apache.org/tomcat/FAQ/Memory
>
> Also, take a look at these:
>
> http://blogs.sun.com/fkieviet/entry/classloader_leaks_the_dreaded_java
> http://blogs.sun.com/fkieviet/entry/how_to_fix_the_dreaded
>
>  - Chuck
>
>
> THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
> MATERIAL and is thus for use only by the intended recipient. If you received
> this in error, please contact the sender and delete the e-mail and its
> attachments from all computers.
>
>

RE: OutOfMemoryError some time on some tomcat!!!!1

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: xu cheng [mailto:xcheng.222@gmail.com] 
> Subject: Re: OutOfMemoryError some time on some tomcat!!!!1

> > hanging onto a reference to an object from your webapp classes,
> > preventing the old webapp deployment from being garbage collected.

> what kind of object do you mean by saying this?

Something is keeping a reference to an object (or class) defined in your webapp, or to the classloader for your webapp.  Likely candidates include thread locals, loggers, and auxiliary threads started (but not stopped) by the webapp.  Until the offending reference is nulled out, the object can't be collected, so its classloader can't be collected, so the old webapp stays in memory.

Any heap profiler should be able to find the references to your webapp classes, although the process may well be tedious.

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


Re: OutOfMemoryError some time on some tomcat!!!!1

Posted by xu cheng <xc...@gmail.com>.
hi:
thanks for the references. I 'll read that.
by the way,
*hanging onto a reference to an object from your webapp classes, preventing
the old webapp deployment from being garbage collected. *

what kind of object do you mean by saying this? classes relevant to the
class loader? or something else? for example?
thanks


2010/11/23 Caldarale, Charles R <Ch...@unisys.com>

> > From: xu cheng [mailto:xcheng.222@gmail.com]
> > Subject: Re: OutOfMemoryError some time on some tomcat!!!!1
>
> > I just kept redeploying apps , and the perm gen keep
> > growing each time I deploy the same app. and when I
> > undeploy the app, the perm gen didn't clean the garbage
>
> Exactly the situation I suggested the other day: you have something that's
> hanging onto a reference to an object from your webapp classes, preventing
> the old webapp deployment from being garbage collected.  Again, read this:
>
> http://wiki.apache.org/tomcat/FAQ/Memory
>
> Also, take a look at these:
>
> http://blogs.sun.com/fkieviet/entry/classloader_leaks_the_dreaded_java
> http://blogs.sun.com/fkieviet/entry/how_to_fix_the_dreaded
>
>  - 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-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

RE: OutOfMemoryError some time on some tomcat!!!!1

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: xu cheng [mailto:xcheng.222@gmail.com] 
> Subject: Re: OutOfMemoryError some time on some tomcat!!!!1

> I just kept redeploying apps , and the perm gen keep 
> growing each time I deploy the same app. and when I 
> undeploy the app, the perm gen didn't clean the garbage

Exactly the situation I suggested the other day: you have something that's hanging onto a reference to an object from your webapp classes, preventing the old webapp deployment from being garbage collected.  Again, read this:

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

Also, take a look at these:

http://blogs.sun.com/fkieviet/entry/classloader_leaks_the_dreaded_java
http://blogs.sun.com/fkieviet/entry/how_to_fix_the_dreaded

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


Re: OutOfMemoryError some time on some tomcat!!!!1

Posted by xu cheng <xc...@gmail.com>.
ps:
after several times of redeployment,
java.lang.OutOfMemoryError: PermGen space comes up.
I always redeploy the  apps *without* shutting down the server

在 2010年11月23日 下午1:50,xu cheng <xc...@gmail.com>写道:

> hi Daniel
> thanks alot for replying.
>
> I don't know how to figure out how much the param MaxPermSize is set to.
> may be it's set to be default. I just set the xmx and xms, so I thought that
> the memory will absolutely enough, I didn't
> notice this param, my fault.
>
> I did an experiment on tomcat , I just kept redeploying apps , and the perm
> gen keep growing each time I deploy the same app. and when I undeploy the
> app, the perm gen didn't clean the garbage
> ( I think they are garbage, but I don't know whether the vm can figure it
> out, I monitor this with the
> jconsole in the jdk/bin). in the meanwhile , the code cache in the memory
> pool and the loaded classes grow with the same curve like the permanent
> generation. the unused class meta data wasn't cleaned up during each
> deployment.
>
> I always redeploy the  apps with shutting down the server, I think that
> might be the point.
>
> by the way , this aritical help me a lot to understand it.
>
> http://blogs.sun.com/jonthecollector/entry/presenting_the_permanent_generation
>
> thanks again for helping
>
> 2010/11/23 Daniel Baktiar <db...@gmail.com>
>
> hi xu cheng,
>>
>> having a powerful machine with big memory is good. but don't assume that
>> everything will be used automatically.
>> the jvm doesn't automatically use all the resources in your memory when
>> you
>> start tomcat. you need to configure it.
>> try to add something like this:
>> *CATALINA_OPTS="-XX:MaxPermSize=512m" *
>> inside your catalina.sh (linux/unix) or catalina.bat (windows).
>> you can put this as the first line (after the comments, for example).
>>
>> try to run again and see whether you still have the same error(s).
>>
>> PermGen space is the permanent generational heap for storing data such as
>> class data. you will bump into this when deploying a large application or
>> deploying repetitively. you will still get the exception when deploying
>> often, only less frequent.
>> ---
>> daniel baktiar
>> http://savinggaia.tritiumapps.com - saving the planet is everyone's
>> business!
>>
>>
>>
>>
>> 2010/11/22 xu cheng <xc...@gmail.com>
>>
>> > after tracing the app with jprofiler for several hours , I still cannot
>> > figure the problem.
>> > it seems that the app doesn't use  a lot of memory.
>> > and it still run pretty well in my computer.and after it is deployed in
>> the
>> > server, it crash....
>> > the problem of the environment? but the tomcat on the server has been
>> > running for a really long time with out any problem....
>> > what's the point?.oh no   (°ο°)
>> >
>> > 2010/11/22 xu cheng <xc...@gmail.com>
>> >
>> > > by the way,
>> > > it doesn't throws this exception while running on my computer
>> > > it is only when the app is deploy on another computer that this
>> problem
>> > > occur
>> > >
>> > > 2010/11/22 xu cheng <xc...@gmail.com>
>> > >
>> > > hi:
>> > >> thanks for replying
>> > >> the app is running on a powerful server and the memory is suppose to
>> be
>> > >> enough
>> > >> I'll check if there is a memory leak,(althouth the app is suppose to
>> use
>> > >> only a few memory)
>> > >> thanks
>> > >>
>> > >> 2010/11/22 Caldarale, Charles R <Ch...@unisys.com>
>> > >>
>> > >> > From: xu cheng [mailto:xcheng.222@gmail.com]
>> > >>> > Subject: OutOfMemoryError some time on some tomcat!!!!1
>> > >>>
>> > >>> > the app works pretty well on my pc, and the tomcat
>> > >>> > is apache-tomcat-6.0.29
>> > >>> > however , when I put this app on to another computer
>> > >>> > with the same tomcat it throws this exception
>> > >>> > Java HotSpot(TM) 64-Bit Server VM warning: Exception
>> > >>> > java.lang.OutOfMemoryError
>> > >>>
>> > >>> > Exception in thread "http-8080-24"
>> > >>> > java.lang.OutOfMemoryError: PermGen space
>> > >>>
>> > >>> 64-bit JVMs often require larger heap sizes than 32-bit ones.  If
>> the
>> > >>> error occurs on the first deployment of the app, you may just need
>> to
>> > >>> configure a larger PermGen.  However, if this error occurs only
>> after
>> > >>> redeploying your app some number of times, you likely have a memory
>> > leak.
>> > >>>  Use any of the widely available profilers or heap analysis tools to
>> > see
>> > >>> just what is consuming memory.  You can get some pointers here:
>> > >>>
>> > >>> http://wiki.apache.org/tomcat/FAQ/Memory
>> > >>>
>> > >>>  - 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-unsubscribe@tomcat.apache.org
>> > >>> For additional commands, e-mail: users-help@tomcat.apache.org
>> > >>>
>> > >>>
>> > >>
>> > >
>> >
>>
>
>

Re: OutOfMemoryError some time on some tomcat!!!!1

Posted by Daniel Baktiar <db...@gmail.com>.
hi xu cheng,

don't mention it.
glad you've eventually solved your problem.

daniel

---
daniel baktiar
http://savinggaia.tritiumapps.com - saving the planet is everyone's
business!




2010/11/23 xu cheng <xc...@gmail.com>

> hi Daniel
> thanks alot for replying.
>
> I don't know how to figure out how much the param MaxPermSize is set to.
> may be it's set to be default. I just set the xmx and xms, so I thought that
> the memory will absolutely enough, I didn't
> notice this param, my fault.
>
> I did an experiment on tomcat , I just kept redeploying apps , and the perm
> gen keep growing each time I deploy the same app. and when I undeploy the
> app, the perm gen didn't clean the garbage
> ( I think they are garbage, but I don't know whether the vm can figure it
> out, I monitor this with the
> jconsole in the jdk/bin). in the meanwhile , the code cache in the memory
> pool and the loaded classes grow with the same curve like the permanent
> generation. the unused class meta data wasn't cleaned up during each
> deployment.
>
> I always redeploy the  apps with shutting down the server, I think that
> might be the point.
>
> by the way , this aritical help me a lot to understand it.
>
> http://blogs.sun.com/jonthecollector/entry/presenting_the_permanent_generation
>
> thanks again for helping
>
> 2010/11/23 Daniel Baktiar <db...@gmail.com>
>
>> hi xu cheng,
>>
>> having a powerful machine with big memory is good. but don't assume that
>> everything will be used automatically.
>> the jvm doesn't automatically use all the resources in your memory when
>> you
>> start tomcat. you need to configure it.
>> try to add something like this:
>> *CATALINA_OPTS="-XX:MaxPermSize=512m" *
>> inside your catalina.sh (linux/unix) or catalina.bat (windows).
>> you can put this as the first line (after the comments, for example).
>>
>> try to run again and see whether you still have the same error(s).
>>
>> PermGen space is the permanent generational heap for storing data such as
>> class data. you will bump into this when deploying a large application or
>> deploying repetitively. you will still get the exception when deploying
>> often, only less frequent.
>> ---
>> daniel baktiar
>> http://savinggaia.tritiumapps.com - saving the planet is everyone's
>> business!
>>
>>
>>
>>
>>
>

Re: OutOfMemoryError some time on some tomcat!!!!1

Posted by xu cheng <xc...@gmail.com>.
hi Daniel
thanks alot for replying.

I don't know how to figure out how much the param MaxPermSize is set to. may
be it's set to be default. I just set the xmx and xms, so I thought that the
memory will absolutely enough, I didn't
notice this param, my fault.

I did an experiment on tomcat , I just kept redeploying apps , and the perm
gen keep growing each time I deploy the same app. and when I undeploy the
app, the perm gen didn't clean the garbage
( I think they are garbage, but I don't know whether the vm can figure it
out, I monitor this with the
jconsole in the jdk/bin). in the meanwhile , the code cache in the memory
pool and the loaded classes grow with the same curve like the permanent
generation. the unused class meta data wasn't cleaned up during each
deployment.

I always redeploy the  apps with shutting down the server, I think that
might be the point.

by the way , this aritical help me a lot to understand it.
http://blogs.sun.com/jonthecollector/entry/presenting_the_permanent_generation

thanks again for helping

2010/11/23 Daniel Baktiar <db...@gmail.com>

> hi xu cheng,
>
> having a powerful machine with big memory is good. but don't assume that
> everything will be used automatically.
> the jvm doesn't automatically use all the resources in your memory when you
> start tomcat. you need to configure it.
> try to add something like this:
> *CATALINA_OPTS="-XX:MaxPermSize=512m" *
> inside your catalina.sh (linux/unix) or catalina.bat (windows).
> you can put this as the first line (after the comments, for example).
>
> try to run again and see whether you still have the same error(s).
>
> PermGen space is the permanent generational heap for storing data such as
> class data. you will bump into this when deploying a large application or
> deploying repetitively. you will still get the exception when deploying
> often, only less frequent.
> ---
> daniel baktiar
> http://savinggaia.tritiumapps.com - saving the planet is everyone's
> business!
>
>
>
>
> 2010/11/22 xu cheng <xc...@gmail.com>
>
> > after tracing the app with jprofiler for several hours , I still cannot
> > figure the problem.
> > it seems that the app doesn't use  a lot of memory.
> > and it still run pretty well in my computer.and after it is deployed in
> the
> > server, it crash....
> > the problem of the environment? but the tomcat on the server has been
> > running for a really long time with out any problem....
> > what's the point?.oh no   (°ο°)
> >
> > 2010/11/22 xu cheng <xc...@gmail.com>
> >
> > > by the way,
> > > it doesn't throws this exception while running on my computer
> > > it is only when the app is deploy on another computer that this problem
> > > occur
> > >
> > > 2010/11/22 xu cheng <xc...@gmail.com>
> > >
> > > hi:
> > >> thanks for replying
> > >> the app is running on a powerful server and the memory is suppose to
> be
> > >> enough
> > >> I'll check if there is a memory leak,(althouth the app is suppose to
> use
> > >> only a few memory)
> > >> thanks
> > >>
> > >> 2010/11/22 Caldarale, Charles R <Ch...@unisys.com>
> > >>
> > >> > From: xu cheng [mailto:xcheng.222@gmail.com]
> > >>> > Subject: OutOfMemoryError some time on some tomcat!!!!1
> > >>>
> > >>> > the app works pretty well on my pc, and the tomcat
> > >>> > is apache-tomcat-6.0.29
> > >>> > however , when I put this app on to another computer
> > >>> > with the same tomcat it throws this exception
> > >>> > Java HotSpot(TM) 64-Bit Server VM warning: Exception
> > >>> > java.lang.OutOfMemoryError
> > >>>
> > >>> > Exception in thread "http-8080-24"
> > >>> > java.lang.OutOfMemoryError: PermGen space
> > >>>
> > >>> 64-bit JVMs often require larger heap sizes than 32-bit ones.  If the
> > >>> error occurs on the first deployment of the app, you may just need to
> > >>> configure a larger PermGen.  However, if this error occurs only after
> > >>> redeploying your app some number of times, you likely have a memory
> > leak.
> > >>>  Use any of the widely available profilers or heap analysis tools to
> > see
> > >>> just what is consuming memory.  You can get some pointers here:
> > >>>
> > >>> http://wiki.apache.org/tomcat/FAQ/Memory
> > >>>
> > >>>  - 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-unsubscribe@tomcat.apache.org
> > >>> For additional commands, e-mail: users-help@tomcat.apache.org
> > >>>
> > >>>
> > >>
> > >
> >
>

Re: OutOfMemoryError some time on some tomcat!!!!1

Posted by Daniel Baktiar <db...@gmail.com>.
hi xu cheng,

having a powerful machine with big memory is good. but don't assume that
everything will be used automatically.
the jvm doesn't automatically use all the resources in your memory when you
start tomcat. you need to configure it.
try to add something like this:
*CATALINA_OPTS="-XX:MaxPermSize=512m" *
inside your catalina.sh (linux/unix) or catalina.bat (windows).
you can put this as the first line (after the comments, for example).

try to run again and see whether you still have the same error(s).

PermGen space is the permanent generational heap for storing data such as
class data. you will bump into this when deploying a large application or
deploying repetitively. you will still get the exception when deploying
often, only less frequent.
---
daniel baktiar
http://savinggaia.tritiumapps.com - saving the planet is everyone's
business!




2010/11/22 xu cheng <xc...@gmail.com>

> after tracing the app with jprofiler for several hours , I still cannot
> figure the problem.
> it seems that the app doesn't use  a lot of memory.
> and it still run pretty well in my computer.and after it is deployed in the
> server, it crash....
> the problem of the environment? but the tomcat on the server has been
> running for a really long time with out any problem....
> what's the point?.oh no   (°ο°)
>
> 2010/11/22 xu cheng <xc...@gmail.com>
>
> > by the way,
> > it doesn't throws this exception while running on my computer
> > it is only when the app is deploy on another computer that this problem
> > occur
> >
> > 2010/11/22 xu cheng <xc...@gmail.com>
> >
> > hi:
> >> thanks for replying
> >> the app is running on a powerful server and the memory is suppose to be
> >> enough
> >> I'll check if there is a memory leak,(althouth the app is suppose to use
> >> only a few memory)
> >> thanks
> >>
> >> 2010/11/22 Caldarale, Charles R <Ch...@unisys.com>
> >>
> >> > From: xu cheng [mailto:xcheng.222@gmail.com]
> >>> > Subject: OutOfMemoryError some time on some tomcat!!!!1
> >>>
> >>> > the app works pretty well on my pc, and the tomcat
> >>> > is apache-tomcat-6.0.29
> >>> > however , when I put this app on to another computer
> >>> > with the same tomcat it throws this exception
> >>> > Java HotSpot(TM) 64-Bit Server VM warning: Exception
> >>> > java.lang.OutOfMemoryError
> >>>
> >>> > Exception in thread "http-8080-24"
> >>> > java.lang.OutOfMemoryError: PermGen space
> >>>
> >>> 64-bit JVMs often require larger heap sizes than 32-bit ones.  If the
> >>> error occurs on the first deployment of the app, you may just need to
> >>> configure a larger PermGen.  However, if this error occurs only after
> >>> redeploying your app some number of times, you likely have a memory
> leak.
> >>>  Use any of the widely available profilers or heap analysis tools to
> see
> >>> just what is consuming memory.  You can get some pointers here:
> >>>
> >>> http://wiki.apache.org/tomcat/FAQ/Memory
> >>>
> >>>  - 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-unsubscribe@tomcat.apache.org
> >>> For additional commands, e-mail: users-help@tomcat.apache.org
> >>>
> >>>
> >>
> >
>

Re: OutOfMemoryError some time on some tomcat!!!!1

Posted by xu cheng <xc...@gmail.com>.
after tracing the app with jprofiler for several hours , I still cannot
figure the problem.
it seems that the app doesn't use  a lot of memory.
and it still run pretty well in my computer.and after it is deployed in the
server, it crash....
the problem of the environment? but the tomcat on the server has been
running for a really long time with out any problem....
what's the point?.oh no   (°ο°)

2010/11/22 xu cheng <xc...@gmail.com>

> by the way,
> it doesn't throws this exception while running on my computer
> it is only when the app is deploy on another computer that this problem
> occur
>
> 2010/11/22 xu cheng <xc...@gmail.com>
>
> hi:
>> thanks for replying
>> the app is running on a powerful server and the memory is suppose to be
>> enough
>> I'll check if there is a memory leak,(althouth the app is suppose to use
>> only a few memory)
>> thanks
>>
>> 2010/11/22 Caldarale, Charles R <Ch...@unisys.com>
>>
>> > From: xu cheng [mailto:xcheng.222@gmail.com]
>>> > Subject: OutOfMemoryError some time on some tomcat!!!!1
>>>
>>> > the app works pretty well on my pc, and the tomcat
>>> > is apache-tomcat-6.0.29
>>> > however , when I put this app on to another computer
>>> > with the same tomcat it throws this exception
>>> > Java HotSpot(TM) 64-Bit Server VM warning: Exception
>>> > java.lang.OutOfMemoryError
>>>
>>> > Exception in thread "http-8080-24"
>>> > java.lang.OutOfMemoryError: PermGen space
>>>
>>> 64-bit JVMs often require larger heap sizes than 32-bit ones.  If the
>>> error occurs on the first deployment of the app, you may just need to
>>> configure a larger PermGen.  However, if this error occurs only after
>>> redeploying your app some number of times, you likely have a memory leak.
>>>  Use any of the widely available profilers or heap analysis tools to see
>>> just what is consuming memory.  You can get some pointers here:
>>>
>>> http://wiki.apache.org/tomcat/FAQ/Memory
>>>
>>>  - 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-unsubscribe@tomcat.apache.org
>>> For additional commands, e-mail: users-help@tomcat.apache.org
>>>
>>>
>>
>

Re: OutOfMemoryError some time on some tomcat!!!!1

Posted by xu cheng <xc...@gmail.com>.
by the way,
it doesn't throws this exception while running on my computer
it is only when the app is deploy on another computer that this problem
occur

2010/11/22 xu cheng <xc...@gmail.com>

> hi:
> thanks for replying
> the app is running on a powerful server and the memory is suppose to be
> enough
> I'll check if there is a memory leak,(althouth the app is suppose to use
> only a few memory)
> thanks
>
> 2010/11/22 Caldarale, Charles R <Ch...@unisys.com>
>
> > From: xu cheng [mailto:xcheng.222@gmail.com]
>> > Subject: OutOfMemoryError some time on some tomcat!!!!1
>>
>> > the app works pretty well on my pc, and the tomcat
>> > is apache-tomcat-6.0.29
>> > however , when I put this app on to another computer
>> > with the same tomcat it throws this exception
>> > Java HotSpot(TM) 64-Bit Server VM warning: Exception
>> > java.lang.OutOfMemoryError
>>
>> > Exception in thread "http-8080-24"
>> > java.lang.OutOfMemoryError: PermGen space
>>
>> 64-bit JVMs often require larger heap sizes than 32-bit ones.  If the
>> error occurs on the first deployment of the app, you may just need to
>> configure a larger PermGen.  However, if this error occurs only after
>> redeploying your app some number of times, you likely have a memory leak.
>>  Use any of the widely available profilers or heap analysis tools to see
>> just what is consuming memory.  You can get some pointers here:
>>
>> http://wiki.apache.org/tomcat/FAQ/Memory
>>
>>  - 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-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
>>
>>
>

Re: OutOfMemoryError some time on some tomcat!!!!1

Posted by xu cheng <xc...@gmail.com>.
hi:
thanks for replying
the app is running on a powerful server and the memory is suppose to be
enough
I'll check if there is a memory leak,(althouth the app is suppose to use
only a few memory)
thanks

2010/11/22 Caldarale, Charles R <Ch...@unisys.com>

> > From: xu cheng [mailto:xcheng.222@gmail.com]
> > Subject: OutOfMemoryError some time on some tomcat!!!!1
>
> > the app works pretty well on my pc, and the tomcat
> > is apache-tomcat-6.0.29
> > however , when I put this app on to another computer
> > with the same tomcat it throws this exception
> > Java HotSpot(TM) 64-Bit Server VM warning: Exception
> > java.lang.OutOfMemoryError
>
> > Exception in thread "http-8080-24"
> > java.lang.OutOfMemoryError: PermGen space
>
> 64-bit JVMs often require larger heap sizes than 32-bit ones.  If the error
> occurs on the first deployment of the app, you may just need to configure a
> larger PermGen.  However, if this error occurs only after redeploying your
> app some number of times, you likely have a memory leak.  Use any of the
> widely available profilers or heap analysis tools to see just what is
> consuming memory.  You can get some pointers here:
>
> http://wiki.apache.org/tomcat/FAQ/Memory
>
>  - 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-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

RE: OutOfMemoryError some time on some tomcat!!!!1

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: xu cheng [mailto:xcheng.222@gmail.com] 
> Subject: OutOfMemoryError some time on some tomcat!!!!1

> the app works pretty well on my pc, and the tomcat 
> is apache-tomcat-6.0.29
> however , when I put this app on to another computer
> with the same tomcat it throws this exception
> Java HotSpot(TM) 64-Bit Server VM warning: Exception
> java.lang.OutOfMemoryError

> Exception in thread "http-8080-24" 
> java.lang.OutOfMemoryError: PermGen space

64-bit JVMs often require larger heap sizes than 32-bit ones.  If the error occurs on the first deployment of the app, you may just need to configure a larger PermGen.  However, if this error occurs only after redeploying your app some number of times, you likely have a memory leak.  Use any of the widely available profilers or heap analysis tools to see just what is consuming memory.  You can get some pointers here:

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

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