You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by CG <le...@gmail.com> on 2009/03/14 10:14:30 UTC
[T5] How to tackle memory leak problem (Perm Gem Out of Space)
Hi all, I have used T5 to write an application , it works fine ,
however, after using for a while , it will run into problem of
PermGem out of space (on Server)
After doing some googling , i get to know that it may due to program
memory leak problem.
I would like to trace in to code to but I have no idea how can do to
narrow down to the problematic code.
Hopefully some experience Java/T5 developer can give me some guidance
in this case.
Thanks ..
CG
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: [T5] How to tackle memory leak problem (Perm Gem Out of Space)
Posted by Martin Strand <do...@gmail.com>.
1. Get a heap dump, eg add the -XX:+HeapDumpOnOutOfMemoryError flag and wait for the permgen error
2. Install http://www.eclipse.org/mat/
3. Follow this guide which explains how you can use MAT to analyze your heap dump:
http://dev.eclipse.org/blogs/memoryanalyzer/2008/05/17/the-unknown-generation-perm/
Martin
On Sat, 14 Mar 2009 10:14:30 +0100, CG <le...@gmail.com> wrote:
> Hi all, I have used T5 to write an application , it works fine ,
> however, after using for a while , it will run into problem of
> PermGem out of space (on Server)
>
> After doing some googling , i get to know that it may due to program
> memory leak problem.
>
> I would like to trace in to code to but I have no idea how can do to
> narrow down to the problematic code.
>
> Hopefully some experience Java/T5 developer can give me some guidance
> in this case.
>
> Thanks ..
>
> CG
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: [T5] How to tackle memory leak problem (Perm Gem Out of Space)
Posted by CG <le...@gmail.com>.
thx for the reply, i'll get a try on the MAT ... thx ..
CG
On Sat, Mar 14, 2009 at 10:13 PM, Geoffrey Wiseman
<ge...@gmail.com> wrote:
> On Sat, Mar 14, 2009 at 5:14 AM, CG <le...@gmail.com> wrote:
>
>> Hi all, I have used T5 to write an application , it works fine ,
>> however, after using for a while , it will run into problem of
>> PermGem out of space (on Server)
>>
>> After doing some googling , i get to know that it may due to program
>> memory leak problem.
>
>
> It's possible -- although the most likely explanation for Perm-Gen space is
> that you've got a lot of generated classes. That said, it doesn't hurt to
> try and find out.
>
> - Geoffrey
> --
> Geoffrey Wiseman
> http://www.geoffreywiseman.ca/
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: [T5] How to tackle memory leak problem (Perm Gem Out of Space)
Posted by Geoffrey Wiseman <ge...@gmail.com>.
On Sat, Mar 14, 2009 at 5:14 AM, CG <le...@gmail.com> wrote:
> Hi all, I have used T5 to write an application , it works fine ,
> however, after using for a while , it will run into problem of
> PermGem out of space (on Server)
>
> After doing some googling , i get to know that it may due to program
> memory leak problem.
It's possible -- although the most likely explanation for Perm-Gen space is
that you've got a lot of generated classes. That said, it doesn't hurt to
try and find out.
- Geoffrey
--
Geoffrey Wiseman
http://www.geoffreywiseman.ca/
Re: [T5] How to tackle memory leak problem (Perm Gem Out of Space)
Posted by Geoffrey Wiseman <ge...@gmail.com>.
On Thu, Mar 19, 2009 at 8:48 AM, Christoph Jäger <
christoph.jaeger@polleninfo.org> wrote:
> I also have the same problem, searched the web, read lots of blog entries
> and articles of how you can avoid it. The advice found basically is:
> increase the memory available for the permgen, and do not redeploy your
> application too often.
>
> Am I the only one who is not satisfied with this? In my opinion, the ever
> increasing permgen memory consumption in the Sun JVM (I think it is only
> 1.6, but maybe also 1.5) is a bug in the JVM design.
>
Well -- not a bug per se, but perhaps not well-suited to an environment
where class generation and reloading is increasingly common.
If you're not willing to move to a VM without a permanent generation, there
is an option to collect from the permanent generation with the concurrent
mark/sweep collector. You'd want to read into it in more detail to decide
if it's right for your development environment, but it seems like a useful
option:
-XX:+UseConcMarkSweepGC
-XX:+CMSPermGenSweepingEnabled
-XX:+CMSClassUnloadingEnabled
- Geoffrey
--
Geoffrey Wiseman
http://www.geoffreywiseman.ca/
Re: [T5] How to tackle memory leak problem (Perm Gem Out of Space)
Posted by Christoph Jäger <ch...@polleninfo.org>.
Hi,
I also have the same problem, searched the web, read lots of blog
entries and articles of how you can avoid it. The advice found
basically is: increase the memory available for the permgen, and do
not redeploy your application too often.
Am I the only one who is not satisfied with this? In my opinion, the
ever increasing permgen memory consumption in the Sun JVM (I think it
is only 1.6, but maybe also 1.5) is a bug in the JVM design.
The problems that occur have nothing to do with bad programming
practices or buggy application code (although bad practices and buggy
code can increase the problem). Even the best, cleanest application
will show the same behaviour after being reloaded in an application
container for a number of times. And redeploying an application
without restarting the JVM is not such a new, obscure thing that it is
clear there is no support for it.
How is OSGi dealing with this issue (the same problems should occur
there)?
Does any of you know if this issue is addressed in the next, upcoming
versions of the Sun JVM?
Best Regards,
Christoph Jäger
On Mar 17, 2009, at 22:23 , Christian Edward Gruber wrote:
> Yeah, I can't remember how they partition. I do believe it is
> generational though, but it's been a while. Mostly I try to not
> think about it, but I get occasional flashbacks.
>
> Christian.
>
> On Mar 16, 2009, at 9:43 PM, Geoffrey Wiseman wrote:
>
>> On Mon, Mar 16, 2009 at 7:07 PM, Christian Edward Gruber <
>> christianedwardgruber@gmail.com> wrote:
>>
>>> Your behaviour could simply be that the defaults in JRockit are
>>> set such
>>> that you get more permgen space, or that the space is used more
>>> efficiently.
>>> In such a case, you're masking the problem, not resolving it.
>>>
>>
>> I believe the JRockit VM doesn't have a permanent generation
>> (although I
>> don't remember if it's a generational garbage collection system).
>> - Geoffrey
>> --
>> Geoffrey Wiseman
>> http://www.geoffreywiseman.ca/
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: [T5] How to tackle memory leak problem (Perm Gem Out of Space)
Posted by Christian Edward Gruber <ch...@gmail.com>.
Yeah, I can't remember how they partition. I do believe it is
generational though, but it's been a while. Mostly I try to not think
about it, but I get occasional flashbacks.
Christian.
On Mar 16, 2009, at 9:43 PM, Geoffrey Wiseman wrote:
> On Mon, Mar 16, 2009 at 7:07 PM, Christian Edward Gruber <
> christianedwardgruber@gmail.com> wrote:
>
>> Your behaviour could simply be that the defaults in JRockit are set
>> such
>> that you get more permgen space, or that the space is used more
>> efficiently.
>> In such a case, you're masking the problem, not resolving it.
>>
>
> I believe the JRockit VM doesn't have a permanent generation
> (although I
> don't remember if it's a generational garbage collection system).
> - Geoffrey
> --
> Geoffrey Wiseman
> http://www.geoffreywiseman.ca/
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: [T5] How to tackle memory leak problem (Perm Gem Out of Space)
Posted by Geoffrey Wiseman <ge...@gmail.com>.
On Mon, Mar 16, 2009 at 7:07 PM, Christian Edward Gruber <
christianedwardgruber@gmail.com> wrote:
> Your behaviour could simply be that the defaults in JRockit are set such
> that you get more permgen space, or that the space is used more efficiently.
> In such a case, you're masking the problem, not resolving it.
>
I believe the JRockit VM doesn't have a permanent generation (although I
don't remember if it's a generational garbage collection system).
- Geoffrey
--
Geoffrey Wiseman
http://www.geoffreywiseman.ca/
Re: [T5] How to tackle memory leak problem (Perm Gem Out of Space)
Posted by Christian Edward Gruber <ch...@gmail.com>.
That's funny, since jrockit is recommended for deployment, not
development (by BEA anyway). I'd be careful. We got some crazy
garbage collection behaviour on that VM before (using BEA portal, not
T5).
Your behaviour could simply be that the defaults in JRockit are set
such that you get more permgen space, or that the space is used more
efficiently. In such a case, you're masking the problem, not
resolving it.
cheers,
Christian.
On Mar 16, 2009, at 3:12 AM, Koka Kiknadze wrote:
> On Mon, Mar 16, 2009 at 2:20 AM, Peter Lundberg <peter.lundberg.se@gmail.com
>> wrote:
>
>>
>> While developing I get
>> PermGenSpace errors daily but a restart is so fast that it does not
>> affect
>> me.
>>
> I s3witched to using jrockit jvm for development, no permgen errors
> there.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: [T5] How to tackle memory leak problem (Perm Gem Out of Space)
Posted by Koka Kiknadze <22...@gmail.com>.
On Mon, Mar 16, 2009 at 2:20 AM, Peter Lundberg <peter.lundberg.se@gmail.com
> wrote:
>
> While developing I get
> PermGenSpace errors daily but a restart is so fast that it does not affect
> me.
>
I s3witched to using jrockit jvm for development, no permgen errors there.
Re: [T5] How to tackle memory leak problem (Perm Gem Out of Space)
Posted by Peter Lundberg <pe...@gmail.com>.
Well if the MAT result is normal or not I cannot say. While developing I get
PermGenSpace errors daily but a restart is so fast that it does not affect
me.
In production/test we have not had any issue as we rarely redeploy and if to
typically replace the entire war and thus restart the servlet container.
Perhaps you are holding references to Pages in non-tapestry code? See
http://tapestry.apache.org/tapestry5/guide/reload.html
BR
Peter
CG-6 wrote:
>
> Is this normal ?
>
> CG
>
>
--
View this message in context: http://www.nabble.com/-T5--How-to-tackle-memory-leak-problem-%28Perm-Gem-Out-of-Space%29-tp22510707p22532454.html
Sent from the Tapestry - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: [T5] How to tackle memory leak problem (Perm Gem Out of Space)
Posted by CG <le...@gmail.com>.
Hi all , I got the problem when redeploy the application , then I use
MAT to analyse the problem
Below is the result of MAT
The class "java.io.ObjectStreamClass$Caches", loaded by "<system class
loader>", occupies 14,673,024 (30.88%) bytes. The memory is
accumulated in classloader/component
"org.apache.tapestry5.internal.services.ComponentInstantiatorSourceImpl$PackageAwareLoader
@ 0x83427488".
Keywords
org.apache.tapestry5.internal.services.ComponentInstantiatorSourceImpl$PackageAwareLoader
@ 0x83427488
java.io.ObjectStreamClass$Caches
Is this normal ?
CG
On Mon, Mar 16, 2009 at 12:30 AM, Peter Lundberg
<pe...@gmail.com> wrote:
>
> Another way is to check if the application is getting reloaded while you are
> running - hopefully easily observable in the log. Each reload will cause
> more things to get generated and eat up perm gen space. There is some
> configuration you can also use to either increase your jvm permgens space or
> limit how classes get reloaded (eg due to a changed ts on disk).
>
> Hope it helps some.
> /P
>
>
> CG-6 wrote:
>>
>> Hi all, I have used T5 to write an application , it works fine ,
>> however, after using for a while , it will run into problem of
>> PermGem out of space (on Server)
>>
>> After doing some googling , i get to know that it may due to program
>> memory leak problem.
>>
>> I would like to trace in to code to but I have no idea how can do to
>> narrow down to the problematic code.
>>
>> Hopefully some experience Java/T5 developer can give me some guidance
>> in this case.
>>
>> Thanks ..
>>
>> CG
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>>
>>
>
> --
> View this message in context: http://www.nabble.com/-T5--How-to-tackle-memory-leak-problem-%28Perm-Gem-Out-of-Space%29-tp22510707p22524942.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: [T5] How to tackle memory leak problem (Perm Gem Out of Space)
Posted by Peter Lundberg <pe...@gmail.com>.
Another way is to check if the application is getting reloaded while you are
running - hopefully easily observable in the log. Each reload will cause
more things to get generated and eat up perm gen space. There is some
configuration you can also use to either increase your jvm permgens space or
limit how classes get reloaded (eg due to a changed ts on disk).
Hope it helps some.
/P
CG-6 wrote:
>
> Hi all, I have used T5 to write an application , it works fine ,
> however, after using for a while , it will run into problem of
> PermGem out of space (on Server)
>
> After doing some googling , i get to know that it may due to program
> memory leak problem.
>
> I would like to trace in to code to but I have no idea how can do to
> narrow down to the problematic code.
>
> Hopefully some experience Java/T5 developer can give me some guidance
> in this case.
>
> Thanks ..
>
> CG
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>
>
--
View this message in context: http://www.nabble.com/-T5--How-to-tackle-memory-leak-problem-%28Perm-Gem-Out-of-Space%29-tp22510707p22524942.html
Sent from the Tapestry - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org