participate


Java Virtual Machine (JVM) - Diagnosing java.lang.OutOfMemoryError: PermGen space
<<   Back to Forum  |   Give us Feedback
This topic has 8 replies on 1 page.
samuelto
Posts:22
Registered: 7/18/97
Diagnosing java.lang.OutOfMemoryError: PermGen space   
Sep 9, 2005 1:56 AM

 
I am getting this error on our test instance:
Exception in thread "Thread-96425" java.lang.OutOfMemoryError: PermGen space

(We are using JDK 1.5.0_03)

What tools can I use to inspect the contents of PermGen? In particular, is there a way to see all the interned String objects?

I tried jmap -permstat, but it only shows perm gen usage based on classloader. I wasn't sure how to check the intern Strings.

Thanks
Sam
 
zhmur
Posts:110
Registered: 04.05.05
Re: Diagnosing java.lang.OutOfMemoryError: PermGen space   
Sep 9, 2005 3:11 AM (reply 1 of 8)  (In reply to original post )

 
interned strings should be reachable to stay alive during GC (just like any other objects). PermGen size been set adaptivelly, so if you run of out of memory your heap is full. Increase heap size or explore your app with any profiler to find reachable, but unusefull instances.
 
alan.bateman
Posts:487
Registered: 6/20/03
Re: Diagnosing java.lang.OutOfMemoryError: PermGen space   
Sep 9, 2005 4:14 AM (reply 2 of 8)  (In reply to original post )

 
The jmap -permstat option has been updated in mustang (Java SE 6.0) to print out the number of interned strings and the sizes (in bytes). It might be useful if you are willing to try it out (https://mustang.dev.java.net/).
 
Caffeine0001
Posts:1,276
Registered: 1/9/04
Re: Diagnosing java.lang.OutOfMemoryError: PermGen space   
Sep 9, 2005 9:56 AM (reply 3 of 8)  (In reply to original post )

 
If you need to increase the permgen use -XX:MaxPermSize=128m,
where 128m is the max size of the PermGen. By default I believe it is 64m.
 
samuelto
Posts:22
Registered: 7/18/97
Re: Diagnosing java.lang.OutOfMemoryError: PermGen space   
Sep 9, 2005 12:48 PM (reply 4 of 8)  (In reply to #2 )

 
Can I use Mustang's jmap to inspect a JDK 1.5 JVM?
 
alan.bateman
Posts:487
Registered: 6/20/03
Re: Diagnosing java.lang.OutOfMemoryError: PermGen space   
Sep 11, 2005 5:02 AM (reply 5 of 8)  (In reply to #4 )

 
No, jmap (like jinfo and jstack) is tied to the VM verison. This means you would need to be running your applications with Mustang too.
 
M.Rizwan
Posts:4
Registered: 12/6/04
Re: Diagnosing java.lang.OutOfMemoryError: PermGen space   
Apr 20, 2006 3:09 AM (reply 6 of 8)  (In reply to #5 )

 
How can i set the PermGen size so that this problem is rectified. In which file this parameter is to be set and what value should be assigned to PermGen to solve this problem.Thanks
 
etempest
Posts:2
Registered: 6/23/06
Re: Diagnosing java.lang.OutOfMemoryError: PermGen space   
Jun 23, 2006 8:37 AM (reply 7 of 8)  (In reply to #6 )

 
Generally speaking, if you are experiencing this error, tweaking your memory allocation (adjusting your PermGen size) will only alter the frequency with which you encounter the issue.

You can read more about the PermGen error and possible solutions here: http://jroller.com/page/agileanswers/20060623
 
shah_rahul25@hotmail.com
Posts:1
Registered: 2/10/05
Re: Diagnosing java.lang.OutOfMemoryError: PermGen space   
Aug 8, 2007 2:36 AM (reply 8 of 8)  (In reply to #7 )

 
Hi All,

We just to add few things before i go into deep as to what is the root cause that might cause Out Of Memory due to Permanant Generation.

Well recently i had faced this issue in one of the biggest application used in UK.I faced this issue and the resoultion for this took to almost 3 months.Now the issue is resolved.The reason for this was in the application itself.

Well to diagnose this, please add the following parameter into the JVM Options of the instance you are using it.DON'T use parallelGC.

-verbose:gc
-XX:+PrintClassHistogram
-XX:+PrintGCDetails

After this JVM options are added, restart you instance and then check the server.log file.You will see lots of classes.Please do a analysis of this classes.You will observe that some of the classes keeps on growing even after the FULLGC is done.It means that there is some problem you need to check either at the application layer as to which classes are creating this problem.Normally classes or sometimes API's being used by the application can caused PermGen issue.

Well String.intern method normally being used by XML api's .

Please drop me a mail for any further information you require.My id is

goldenbaby@indiatimes.com

Regrads
Rahul Shah
 
This topic has 8 replies on 1 page.
Back to Forum
 
Read the Developer Forums Code of Conduct

Click to email this message Email this Topic

Edit this Topic
  
 
 
Forums Statistics
    Users Online : 25
  • Guests : 145

About Sun forums
  • Sun Forums is a large collection of user generated discussions. It is here to help you ask questions, find answers, and participate in discussions.

    Check out our guide on Getting started with Sun Forums for a full walkthrough of how to best leverage the benefits of this community.

Powered by Jive Forums