2 Replies Latest reply on Sep 20, 2010 3:53 AM by Mario Almeida

    tuning of JVM

    Mario Almeida Newbie

      Hi All,

       

      OS CentOS 5.5 64bit

      I am using JBOSS 4.2.3

      JAVA 1.6u21

       

      JAVA_OPTS=  -server -XX:MaxNewSize=170m -XX:NewSize=170m -Xmx512m -Xms512m -XX:MaxPermSize=256m -Xss256k -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000 -verbose:gc -Djava.net.preferIPv4Stack=true

       

      As per 'GARBAGE COLLECTION STATISTICAL ANALYSIS 201' below is the output of -verbose:gc

       

       

       

      BeforeAfterTime
      6791081600.01124
      816078900.089276
      138450183070.01023
      148867310760.020333
      84187389180.020976
      38918385790.264469
      169139473060.010821
      177866550310.020886
      185591580030.017817
      185363615500.018758
      172014686850.024119
      179149745890.028192
      178397801530.022211
      183961829880.018935
      189484869000.013572
      193396880650.016476
      191393958720.009507
      1992961000370.012184
      2054451017810.007035
      2071891025160.005844
      2093841029510.003822
      2098311044870.004506
      2129941040220.004398
      2126301041380.003814
      2162021052150.004032
      2172791055900.003863
      2221341057910.005497
      2223351060690.00365
      2272671070930.003381
      2283731074260.003942
      2339541082180.004841
      2347461084410.003837
      2399611087760.003702
      2402961096910.004393
      2458831107350.005467
      2469271131580.009279
      2540221120530.007649
      2529171120570.005108
      2570811119990.004932
      2570231130450.00562
      2611411138980.005607
      2619941143880.005883
      2655561144170.004873
      2655851152650.007753
      2688651158270.007209
      2694271167850.006272
      2726671183280.006826
      2742321183510.006551
      2763671184020.005399
      2764181202180.007433
      2799621209630.009114
      2807071198860.005476
      2805261222000.008937
      2828401240720.010552
      2847121223300.006757
      2829701239360.00912
      2853441248900.009292
      2862981243620.007613
      2865381258300.009574
      2880061264040.009543
      2892841266410.009608
      2895211285550.011272
      2917551279260.009885
      2911261292450.011053
      2927021278200.008749
      2914041283740.007936
      2919581291430.007507
      2927271293950.007756
      2932991298690.007054
      2937731307090.007014
      2949971308840.007413
      2951721311180.007388
      2959181325330.007544
      2973331326260.006971
      2979381340400.008049
      2993521344440.007505
      3003961363550.010362
      3023071364720.00994
      3021041366330.008865
      3022271377580.010389
      3037741392740.010978
      3052901390540.011067
      3044301396120.011818
      3049881402420.010733
      3058101406190.010408
      3061871416140.010614
      3076301429190.012793
      3089351442290.014377
      3087091430140.011988
      3074941448050.015654
      3090291434890.011692
      3077131436020.00943
      3078261445600.009486
      3087841458400.01116
      3103841453560.009615
      3099001464270.009441
      3113871490170.011989
      3140091477950.010213
      3126591483030.009085
      3131671502380.011596
      3152301512940.014132
      3162861504060.010096
      3153341523240.012351
      3172521523890.011761
      3175731525330.012058
      3177171523910.010228
      3181511531090.010195
      3188691539290.010222
      3198811548470.010916
      3207991569690.013489
      3226011566070.013065
      3222391584970.014829
      3237451588420.014876
      3240901586530.013889
      3236451604750.016195
      3254671621430.021307
      3245751590370.014079

       

      Even if I increase the heap size and adjust the NewSize to 1/3 I always get a rising graph.

       

      In the article it says Heap usage has stabilize with both the heap usage before collection and after collection forming horizontal lines

       

      In my situation do I still have to increase the heap size more?

       

      heap.png

        • 1. Re: tuning of JVM
          Peter Johnson Master

          The horizonatl line, as noted in the 101 paper, is the ideal. Not all apps will reach that ideal, or to reach it they might require prohibitively large amounts of heap space. I think that what you have here looks really good, you should get major collections only occasionally, which is the goal.

           

          You could increase the heap size (if you have free RAM) and the new size accordingly, that might make a better graph.

           

          Finally, the 101 and 201 papers are fairly old (I think JDK 1.5 was not even out yet for the 101 paper). My recent experiments showed that JDK 6 will automatically adjust the new size to about 1/3 the heap size after a dozen or so collections, so setting new size in JDK 6 is not as important as it once was, so I am no longer recommending setting new size for JDK 6 or later. (My Java performance seminar at this year's CMG Conference has a slide showing how each JVM from 1.3 to 1.6 adjusts, or fails to adjust, the new size over the course of time.)

          1 of 1 people found this helpful
          • 2. Re: tuning of JVM
            Mario Almeida Newbie

            Thanks Peter for the explaination.

             

            I got a better graph by adjusting the -XX:NewSize -XX:MaxNewSize -XX:SurvivorRatio and -XX:NewRatio

             

            Let me do some more test and I'll post the output.