Permanent Generation and GC

Our server application runs fine using ConcMarkSweep GC (or so we thought) on Java 1.5 with
subsecond pauses.
However, we see the permanent generation growing slowly per request, e.g. by 2k.
The unfortunate effect is that when the permanent generation is full, a Full GC cycle takes place
and the 15 seconds spent on that are unacceptable to our client. Ouch.
Q1: Is there a way to avoid the Full GC on the permanent GC? Why isn't it included in the CMS GC
cycles?
From the little information I can find on the permanent generation, it contains
- class data
- interned Strings
Q2: What could be the cause of the substantial growth in the permanent generation.
(I checked the XML parsing, and the invocations of String.intern are not sufficient to explain the
situation). We do a lot of different things with third party jars, XML, XLST, jdom, JDBC (Sybase jconnect), some object (de)serialization and zipping, SSL, Tomcat.. No RMI/EJB.
Any wll-known offenders?
Q3: Are there any tools other than jmap -heap to monitor the object in the permanent generation
specifically? Ideally a full profiling JMVTI app or tracing the calls to the String.intern.
Q4: Is there anything else I'm missing? Have there been changes in this obscure corner of the JVM since 1.4.2?

Probably nothing new for you, up until Q3...
The unfortunate effect is that when the permanent
generation is full, a Full GC cycle takes place
and the 15 seconds spent on that are unacceptable to
our client. Ouch.Have you looked at this tuning doc?
http://java.sun.com/docs/hotspot/gc5.0/gc_tuning_5.html
Q1: Is there a way to avoid the Full GC on the
permanent GC? Why isn't it included in the CMS GC
cycles?For more information on heap sizing and garbage collection issues,
check the white papers here:
http://developers.sun.com/techtopics/mobility/midp/articles/garbagecollection2/
The benchmark application they describe is rather specialized, but the
paper contains some very useful information about heap layout and
garbage collection in general.
From the little information I can find on the
permanent generation, it contains
- class data
- interned Strings
Q2: What could be the cause of the substantial growth
in the permanent generation.
(I checked the XML parsing, and the invocations of
String.intern are not sufficient to explain the
situation). We do a lot of different things with
third party jars, XML, XLST, jdom, JDBC (Sybase
jconnect), some object (de)serialization and zipping,
SSL, Tomcat.. No RMI/EJB.
Any wll-known offenders?See Q3. Hopefully one of the queries listed in the README will help track down the anomaly.
Q3: Are there any tools other than jmap -heap to
monitor the object in the permanent generation
specifically? Ideally a full profiling JMVTI app or
tracing the calls to the String.intern.Have you looked at HAT (Heap Analysis Tool)?
https://hat.dev.java.net
https://hat.dev.java.net/doc/README.html
Hope this helps.
"Troubleshooting Guide for J2SE 5.0",
http://java.sun.com/j2se/1.5/pdf/jdk50_ts_guide.pdf

Similar Messages

  • Permanent Generation GC and concurrent mode failures

    Hello
    I have experienced the following symptoms when a concurrent mode failure occurs (1.4.2_19):
    Perm Gen 100% full but ample space in old generation.
    First, I thought that even though there was ample space in OG, probably there was no ample "contiguous" space due to fragmentation. However, the GC logs always revealed a coincidence between "perm gen full", concurrent mode failure and "ample space in old gen" such that I think that the CMF errors in this case do not occur due to fragmentation.
    So, my question is: If there is ample contiguous space in old generation for a full promotion guarantee, can concurrent mode failures still occur because perm gen is 100%? (assuming not using CMS perm gen sweeping options). My understanding is that the answer is "yes" because by default, perm gen is collected by Full GC which interferes with CMS and causes a concurrent mode failure. Can somebody please confirm? Plan to increase perm gen size, monitor perm gen growth and the enable perm gen sweeping.
    Thank you
    Gavin

    cybergavin wrote:
    My perm gen was not exactly 100% full.
    The perm gen size was set to 128 MBSo
    -XX:MaxPermSize=128m -XX:PermSize=128m
    and every time it reaches around 127 MB, a concurrent mode failure occurs even though there is ample free space in the old generation and the parallel scavenge in the young generation is successful. And I did not get OOM exceptions.
    So, I wanted to confirm whether the error "concurrent mode failure" can be caused by a Full GC caused by a full perm gen as opposed to its typical causes like full promotion failures and old gen fragmentation.Maybe you need to enable [-XX:+CMSIncrementalMode|http://java.sun.com/javase/technologies/hotspot/gc/gc_tuning_6.html#icms.available_options] and maybe [-XX:+CMSIncrementalPacing|http://java.sun.com/javase/technologies/hotspot/gc/gc_tuning_6.html#icms.available_options] and use [-XX:CMSIncrementalSafetyFactor=|http://blogs.sun.com/jonthecollector/entry/what_the_heck_s_a] and/or [-XX:CMSIncrementalDutyCycle=|http://java.sun.com/javase/technologies/hotspot/gc/gc_tuning_6.html#icms.available_options] / [-XX:CMSIncrementalDutyCycleMin=|http://java.sun.com/javase/technologies/hotspot/gc/gc_tuning_6.html#icms.available_options].
    Or you could just try with a larger -XX:MaxPermSize=256m

  • How to diagnose increase in permanent generation?

    Hello,
    My team is observing the following problem which is important to us and that we
    did not yet manage to identify:
    We observe from the gc traces (see extracts below) that the permanent memory
    size keeps increasing slowly (to the point were an java.lang.OutOfMemoryError is
    thrown) but the -verbose:class traces do not show anymore class loading after
    the system "warmup" phase. This was observed using Sun's JDK version 1.4.1.01.04 on
    HPUX, with the following JVM options java -verbose:gc
    -Xverbosegc:file=/tmp/gc.log -XX:+PrintGCDetails -XX:+PrintGCTimeStamps
    -XX:+PrintHeapAtGC -Xms256M -Xmx256M -XX:NewSize=16M
    -XX:MaxNewSize=16M -XX:SurvivorRatio=2 -XX:+UseConcMarkSweepGC
    I would need help to answer the following questions:
    1- what other actions than class loading could possibly explain an increase of
    used space in the permanent generation? The GC FAQ says "The permanent
    generation is used to hold reflective of the VM itself such as class objects and
    method objects". Could use of JNI also affect this space?
    2- how can I configure or instrument the JVM 1.4.1 to track cause of increase of
    used space in the permanent generation? The program we are testing uses 500 MB
    RAM and we often lack physical space on the server to make use of standard
    profiler tools such as JProbe or -hprof standard JVM option: HPUX JVM complains
    about insufficient MAXDSIZE kernel parameters that is already set to 512 MB, and
    plenty swap space is available)
    3- In which version are the "-XX:+TraceClassloading and
    -XX:+TraceClassUnloading" options supported? I read from
    http://java.sun.com/docs/hotspot/gc1.4.2/faq.html that the options
    "-XX:+TraceClassloading and -XX:+TraceClassUnloading" should trace class
    loading, however they don't seem available under JDK 1.4.1 on Windows, and they
    are not either documented in the toolsdocs for JDK 1.4.2
    4- What does -verbose:class option really shows? The toolsdoc says
    "-verbose:class Display information about each class loaded.". Would this also
    display classes dynamically generated such as dynamic proxies (or classes
    loading from custom classloaders)? I suspect this only displays class loaded
    from the system classloader...
    Many thanks for your help,
    Regards,
    Guillaume Berche.
    19735.5: [DefNew: 10511K->2379K(12288K), 0.1241661 secs] 160415K->152624K(258048K) Heap after GC invocations=11590:
    Heap
    def new generation total 12288K, used 2379K [77c00000, 78c00000, 78c00000)
    eden space 8192K, 0% used [77c00000, 77c00000, 78400000)
    from space 4096K, 58% used [78400000, 78652e48, 78800000)
    to space 4096K, 0% used [78800000, 78800000, 78c00000)
    concurrent mark-sweep generation total 245760K, used 150245K [68c00000, 77c00000, 77c00000)
    CompactibleFreeListSpace space 245760K, 61% used [68c00000, 77c00000)
    concurrent-mark-sweep perm gen total 43772K, used 33105K [64c00000, 676bf000, 68c00000)
    CompactibleFreeListSpace space 43772K, 75% used [64c00000, 676bf000)
    } , 0.1262338 secs]
    19737: [GC  {Heap before GC invocations=11590:
    Heap
    def new generation   total 12288K, used 10571K [77c00000, 78c00000, 78c00000)
      eden space   8192K, 100% used [77c00000, 78400000, 78400000)
      from space   4096K,  58% used [78400000, 78652e48, 78800000)
      to   space   4096K,   0% used [78800000, 78800000, 78c00000)
    concurrent mark-sweep generation total 245760K, used 150245K [68c00000, 77c00000, 77c00000)
    CompactibleFreeListSpace space 245760K,  61% used [68c00000, 77c00000)
    concurrent-mark-sweep perm gen total 43772K, used 33106K [64c00000, 676bf000, 68c00000)
    CompactibleFreeListSpace space  43772K,  75% used [64c00000, 676bf000)
    } , 0.1262338 secs]

    I did check the JDK bug database, and you are right, String.intern() does indeed seem to increase size of permanent generation (argnn!)
    Have you experienced cases in which "internalised" String are prevented by the JVM 1.4.1 from being GCed?
    I saw an old bug on JDK 1.1 similar to that:
    http://developer.java.sun.com/developer/bugParade/bugs/4497186.html
    Thanks for your help,
    Guillaume.

  • I had ATV first generation and used to use a software (VideoDrive) to make a quick movie conversion to iTune. Since I purchased the 2nd generation still I can convert the movies but streaming is disabled. Any advise ?

    I had ATV first generation and for the purpose of fast movie converting to iTune I used to use a software ( VideoDrive) , since I purchased the 2nd generation still I can convert movies but streaming via APT is disabled. Please advise if there is any solution for this or a new softawre with high speed converting function.
    Regards

    Many of your points are totally legitimate.
    This one, however, is not:
    …To put it another way, the design of the site seems to be geared much more towards its regular users than those the site is supposedly trying to "help"…
    The design and management of the forums for more than five years have driven literally dozens of the most valuable contributors and "regulars" away from the forums—permanently.
    The only conclusion a prudent, reasonable person can draw from this state of affairs is that Adobe consciously and deliberately want to kill these forums by attrition—without a the PR hit they would otherwise take if they suddenly just shut them down.

  • Garbage collector tuning. Permanent generation

    Hi all,
    I'm learning about garbage collector tuning.
    Why my system always gives for the permanent generation 8192K?
    And why is always full with 8191K? Maybe it is full because my application manages an internal java cache but ....
    Does it is OK that is always full?, how can I change its size?
    [Perm : 8191K->8191K(8192K)], 0.1922860 secs]
    I'm using Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05)
    Linux SuSE
    I'm using the following command
    java -XX:+PrintGCDetails -XX:NewRatio=3 -Xss256k -Xms128m -Xmx256m
    [Full GC [Tenured: 0K->2206K(98304K), 0.1920700 secs] 24643K->2206K(127808K), [Perm : 8191K->8191K(8192K)], 0.1922860 secs]
    [GC [DefNew: 26299K->1168K(29568K), 0.0566740 secs] 28505K->3374K(127872K), 0.0567870 secs]
    [GC [DefNew: 27472K->3264K(29568K), 0.0391920 secs] 29678K->6757K(127872K), 0.0392870 secs]
    [GC [DefNew: 29567K->3264K(29568K), 0.0756940 secs] 33061K->12212K(127872K), 0.0757840 secs]
    Thaks,

    Hi!
    In the permanent generation you have data like class information and static strings. This data is usually never garbage-collected since it never becomes garbage anyway (it is "permanent data"). Per default, the JVM starts with a very small perm gen (somewhere around 4 MB, I believe, but this may be system specific). The default max size for the perm gen is 64 MB on most systems.
    If your application needs more space in the perm gen than initially allocated, the JVM will enlarge the perm gen until your data fits into the perm gen (or the max size is reached). In your case your applications seems to need 8 MB perm space, therefore the JVM enlarges the perm gen until it is 8 MB large.
    So, to answer your question, it's totally ok that your perm gen is 8 MB large and always full. There is no need to change its size in your case. If you still want to do it, you can use -XX:PermSize=<initalSize> and -XX:MaxPermSize=<maxSize>. Setting -XX:PermSize=8m may speed up your application start a little since the JVM allocates enough space right in the beginning and doesn't need to enlarge the perm gen afterwards.
    Nick.

  • Can I return my Ipod touch 4th generation and get an Ipad, if my Ipod is still under warranty?

    Can I return my Ipod touch 4th generation and get an Ipad 2, if my ipod is still under warranty?

    The warranty doesn't cover that. Sell it and put the money towards a new device.
    (79450)

  • I just got the new ipod touch (5th generation) and it will show up on my computer but it will not show up on itunes and it won't connect. Please help!

    I just got the new ipod touch (5th generation) and it will show up on my computer but it will not show up on itunes and it won't connect. Please help!

    See:
    iOS: Device not recognized in iTunes for Windows
    You need iTunes version 10.7

  • I just found my old ipod touch (i think 1st generation) and would like to let my toddler use it instead of my phone.  I am trying to download apps but it say I need to update to 4.3 but it won't let me update.  I have the most recent itunes. any idea why?

    I just found my old ipod touch (i think 1st generation) and would like to let my toddler use it instead of my phone.  I am trying to download apps but it say I need to update to 4.3 but it won't let me update.  I have the most recent itunes. any idea why? I saw a thread saying to purchase the newest software (that was posted a few years ago) I paid 4.95 for the software and it's still saying it can't be updated.  Am I just SOL??

    The 1G iPod can only go as high as 3.1.3. The 1G does not have an internal speaker or volume buttons on the upper left edge.
    Identifying iPod models
    To more easily find compatible apps:
    iOSSearch - search the iTunes store for compatible apps.
    Apple Club - filter apps by iOS version.

  • I have an iPod 5th generation and it is my second iPod but when I try to buy a song it says I need to answer security questions but they are ones I don't recognize or know the awnser to!! Help!!

    My second iPod is a 5th generation and when I try to buy something it says it needs make sure I am who I say I am and it makes me answer security questions. But the problem is I don't know the answers to them. I did not choose them. And if I can't find an answer I can't buy anything!!! Help!!!!

    You need to log in to your Apple ID and change you security questions.  Take a look at this link, http://www.apple.com/support/appleid/

  • My home button is broken ipod touch 5th generation and wont open and itunes wont recognize it

    my home button is broken ipod touch 5th generation and wont open and itunes wont recognize it

    Turn on without Home/Power Button

  • We are going to Great Britain this summer.  Do we need voltage converters as we'll plug adapters for our iPads (one is 2nd generation and one 4th)

    We are going o Great Britain this summer.  Do we need voltage converters as well as plug adapters for our iPads (one is 2nd generation and one 4th)

    No. Since Apple power converter work from 110 to 240 volts, no power converter is reguired.
    You will need a pin adaprt. I have found my local Ace hardware store to have the best deal on them.
    Allan

  • Please help block my ipod touch second generation and forget the code, try putting the code so many times that now says connect to itunes, I connect but will not let me do anything that tells me this should unlock with key and I should do for Please help!

    please helpme i block my ipod touch second generation and forget the code, try putting the code so many times that now says connect to itunes, I connect but will not let me do anything that tells me this  should unlock with key and I should do for Please help!. thanks

    Place the iPOd in recovery mode and then restore. For recovery mode:
    iPhone and iPod touch: Unable to update or restore

  • I tried downloading the iOS8 to my iPod 5th generation and when it finished downloading it shut down completely and it said there was an error and no the iPod is in recovery mode. What can I do to restore it and update it? Please, I need help.

    Hello,
    I recently tried downloading the IOS8 to my iPod 5th generation and when it was almost done the computer said there was an error. Right after that, the iPod shut down completely and now it's on recovery mode. I plugged it in and it said that I had to restore it and update it so I could use it again but it doesn't let me. What can I do? I even did a backup before the update.
    I really need help.

    What happens when you connect to computer and restore via iTunes?
    Without knowing that:
    Try:                                               
    - iOS: Not responding or does not turn on           
    - Also try DFU mode after try recovery mode
    How to put iPod touch / iPhone into DFU mode « Karthik's scribblings
    - If not successful and you can't fully turn the iOS device fully off, let the battery fully drain. After charging for an least an hour try the above again.
    - Try another cable       
    - Try on another computer                                                       
    - If still not successful that usually indicates a hardware problem and an appointment at the Genius Bar of an Apple store is in order.
    Apple Retail Store - Genius Bar                                     

  • I just got an iPod 4th generation and Im trying to sync my iTunes songs from my dell laptop on to my iPod but it says I need iTunes 10.6.3. So I tryed to download it on the apple website but it keeps saying that there is an error. Any answers?

    I just got an iPod 4th generation and Im trying to sync my iTunes songs and books from my dell laptop on to my iPod but it says I need iTunes 10.6.3. So I tryed to download it on the apple website but it keeps saying that there is an error. I have already tryed uninstalling all Apple Inc. programs on my laptop then trying to install iTunes again but that has had no success what so ever. I have started to get very frusterated with this . Hopefully someone can help. I would really appreciate it. Any suggestion?

    So I tryed to download it on the apple website but it keeps saying that there is an error.
    What does the error message say? (Precise text, please.)

  • HT1535 I own an iPhone4, an iPod 3rd generation and an iPad 2. I use the same iTunes library but unfortunately synced iPad with a different computer before syncing to my own. Do I risk losing the films/apps I've downloaded onto my iPad if I sync with my i

    I don't want to sync what is on my iPod to my iPad. (I have a 32gb iPod but only 16gb on iPad. The iPod I use mostly for music.) I can't seem to add the films I have downloaded onto iPad to iTunes. If I could do that, I could erase them from iPad to create more storage.
    This is intensely confusing, sorry.

    Question.....
    "I own an iPhone4, an iPod 3rd generation and an iPad 2. I use the same iTunes library but unfortunately synced iPad with a different computer before syncing to my own. Do I risk losing the films/apps I've downloaded onto my iPad if I sync with my iPod?"
    Answer.....
    Yes you will lose the films that you downloaded to the iPad when you sync with your own iTunes unless you transfer the purchases into your own iTunes library. Were these movies that you purchased? If so, you might be able to download them again for free. Do you have multiple computers that you sync from or is this someone else's purchased content?
    You can select whatever you want to sync to all of your devices in iTunes, you do not have to sync the same content to all device.
    iTunes 11 for Windows: Set up syncing for iPod, iPhone, or iPad
    iOS: Syncing with iTunes - Support - Apple

Maybe you are looking for