3 Replies Latest reply on Dec 2, 2005 11:02 AM by Peter Johnson

    where to set memory options mainly GC options to reclaim mem

    chaitanya Novice

      i have deployed our application in 4GB RAM redhat linux machine;our application size is 9 MB.

      after some time application gets hanging and it takes lot of time to process .in jboss-4.0.2 where to set memory options mainly GC options to reclaim memory.

        • 1. Re: where to set memory options mainly GC options to reclaim
          Peter Johnson Master

          In ./bin/run.sh, set the JAVA_OPTS variable.

          See the slide title JVM Heap Tuning in http://www.jboss.com/pdf/jbworld/scaling_up_jboss.pdf for some suggested heap settings. You will probably have to adjust the settings to work best for your application, but you will have to gather garbage collection statistics first to do that.

          • 2. Re: where to set memory options mainly GC options to reclaim
            chaitanya Novice

            in linux machine i think i have to set in run.conf not in run.sh

            GC statistics

            0.000: [Full GC 43056K->3232K(1995584K), 0.1017290 secs]
            19.152: [Full GC 310183K->29863K(1995584K), 0.5599290 secs]
            28.642: [Full GC 151755K->41235K(1995584K), 0.4659610 secs]
            36.789: [Full GC 105982K->44675K(1995584K), 0.5443090 secs]
            42.495: [Full GC 89403K->48017K(1995584K), 0.4629150 secs]
            95.247: [Full GC 203727K->63797K(1995584K), 0.7384120 secs]
            156.007: [Full GC 207485K->67505K(1995584K), 0.6151420 secs]
            216.627: [Full GC 237287K->67165K(1995584K), 0.7691810 secs]
            277.415: [Full GC 216046K->67974K(1995584K), 0.6389550 secs]
            338.072: [Full GC 78865K->68126K(1995584K), 0.5776390 secs]
            398.657: [Full GC 155644K->68861K(1995584K), 0.6358630 secs]
            459.305: [Full GC 139686K->68781K(1995584K), 0.7161050 secs]
            520.027: [Full GC 91294K->68919K(1995584K), 0.6028460 secs]
            580.634: [Full GC 138924K->69426K(1995584K), 0.6144560 secs]
            641.261: [Full GC 146479K->70863K(1995584K), 0.6329760 secs]
            701.909: [Full GC 285628K->69775K(1995584K), 0.8397260 secs]
            762.755: [Full GC 363006K->71200K(1995584K), 0.7066030 secs]
            823.470: [Full GC 294119K->72333K(1995584K), 0.6970350 secs]
            874.732: [GC 491789K->74026K(1995584K), 0.1089200 secs]
            884.177: [Full GC 115882K->74151K(1995584K), 0.7229020 secs]
            944.908: [Full GC 332261K->73801K(1995584K), 0.8645210 secs]
            1005.786: [Full GC 253125K->75517K(1995584K), 0.7131530 secs]
            1066.510: [Full GC 121434K->76026K(1995584K), 0.6602990 secs]
            1127.176: [Full GC 124343K->76244K(1995584K), 0.6598170 secs]
            1187.850: [Full GC 115744K->74750K(1995584K), 0.7925360 secs]
            1248.649: [Full GC 198637K->75891K(1995584K), 0.6881440 secs]
            1309.358: [Full GC 112177K->76728K(1995584K), 0.6876470 secs]
            1370.058: [Full GC 117248K->77172K(1995584K), 0.6671970 secs]
            1430.739: [Full GC 238478K->77818K(1995584K), 0.7591070 secs]
            1491.506: [Full GC 110401K->78024K(1995584K), 0.6887460 secs]
            1552.212: [Full GC 107810K->78130K(1995584K), 0.6633600 secs]
            1612.898: [Full GC 203990K->79328K(1995584K), 0.7185540 secs]
            1673.628: [Full GC 157964K->78507K(1995584K), 0.7591700 secs]
            1734.398: [Full GC 89108K->78598K(1995584K), 0.6604640 secs]
            1795.064: [Full GC 153746K->78878K(1995584K), 0.7042050 secs]
            1855.776: [Full GC 171091K->81589K(1995584K), 0.6912410 secs]
            1916.479: [Full GC 192075K->80537K(1995584K), 0.8011520 secs]
            1977.292: [Full GC 301498K->81135K(1995584K), 0.7289410 secs]
            2038.028: [Full GC 110636K->81426K(1995584K), 0.6831570 secs]
            2098.716: [Full GC 138538K->82332K(1995584K), 0.6978060 secs]
            2159.432: [Full GC 224858K->80119K(1995584K), 0.8734070 secs]
            2220.318: [Full GC 175500K->81938K(1995584K), 0.7285880 secs]
            2281.059: [Full GC 126414K->82130K(1995584K), 0.6768890 secs]
            2341.748: [Full GC 144318K->82752K(1995584K), 0.6975400 secs]
            2402.458: [Full GC 116658K->80461K(1995584K), 0.8354640 secs]
            2463.317: [Full GC 118225K->81181K(1995584K), 0.7039970 secs]
            2524.027: [Full GC 198302K->81771K(1995584K), 0.7509550 secs]
            2584.787: [Full GC 248849K->82192K(1995584K), 0.7544820 secs]
            2645.548: [Full GC 206241K->80299K(1995584K), 0.9173360 secs]
            2706.477: [Full GC 166445K->80752K(1995584K), 0.6955720 secs]
            2767.179: [Full GC 146002K->85211K(1995584K), 0.7269270 secs]
            2827.919: [Full GC 133720K->85594K(1995584K), 0.7013380 secs]
            2888.624: [Full GC 115129K->82389K(1995584K), 0.8600080 secs]
            2949.494: [Full GC 108046K->82586K(1995584K), 0.6755450 secs]
            3010.174: [Full GC 114849K->83128K(1995584K), 0.6667300 secs]
            3070.844: [Full GC 101591K->83278K(1995584K), 0.6747010 secs]
            3131.524: [Full GC 100449K->81880K(1995584K), 0.7968810 secs]
            3192.324: [Full GC 102675K->82011K(1995584K), 0.7082890 secs]
            3253.037: [Full GC 169470K->82690K(1995584K), 0.7279560 secs]
            3313.782: [Full GC 168348K->83107K(1995584K), 0.6944140 secs]
            3374.487: [Full GC 127830K->82286K(1995584K), 0.7880840 secs]
            3435.304: [Full GC 112612K->82518K(1995584K), 0.7033830 secs]
            3496.014: [Full GC 102854K->82976K(1995584K), 0.7034820 secs]
            3556.724: [Full GC 130197K->83528K(1995584K), 0.7018140 secs]
            3617.437: [Full GC 183531K->85941K(1995584K), 0.7828120 secs]
            3678.232: [Full GC 120710K->86481K(1995584K), 0.7050850 secs]
            3738.947: [Full GC 139843K->86854K(1995584K), 0.7165580 secs]
            3799.677: [Full GC 238948K->87441K(1995584K), 0.7219030 secs]
            3860.404: [Full GC 131266K->86089K(1995584K), 0.7614100 secs]
            3921.174: [Full GC 128599K->88451K(1995584K), 0.7015800 secs]
            3981.885: [Full GC 122901K->88635K(1995584K), 0.7340000 secs]
            4042.637: [Full GC 271102K->102641K(1995584K), 0.7460790 secs]
            4103.408: [Full GC 196804K->94482K(1995584K), 0.8135120 secs]
            4164.239: [Full GC 151902K->95246K(1995584K), 0.7158810 secs]
            4224.969: [Full GC 128859K->95422K(1995584K), 0.7371500 secs]
            4285.724: [Full GC 190294K->95925K(1995584K), 0.7929860 secs]
            4346.538: [Full GC 142383K->94471K(1995584K), 0.7450240 secs]
            4407.297: [Full GC 126663K->94665K(1995584K), 0.7103160 secs]
            4468.017: [Full GC 136728K->94909K(1995584K), 0.7009820 secs]
            4528.724: [Full GC 158791K->95153K(1995584K), 0.7146170 secs]
            4589.447: [Full GC 117481K->94648K(1995584K), 0.8697220 secs]
            4650.327: [Full GC 149276K->95097K(1995584K), 0.7123650 secs]
            4711.048: [Full GC 111408K->95261K(1995584K), 0.7162620 secs]
            4771.783: [Full GC 146211K->95501K(1995584K), 0.7230920 secs]
            4832.525: [Full GC 128451K->95562K(1995584K), 0.7744170 secs]
            4893.327: [Full GC 115288K->96191K(1995584K), 0.7387170 secs]
            4954.083: [Full GC 170777K->96659K(1995584K), 0.7224410 secs]
            5014.817: [Full GC 227645K->97156K(1995584K), 0.7790160 secs]
            5075.616: [Full GC 220953K->95142K(1995584K), 0.9058720 secs]
            5136.524: [Full GC 153758K->120664K(1995584K), 0.7700380 secs]
            5197.309: [Full GC 184943K->121506K(1995584K), 0.7850490 secs]
            5258.109: [Full GC 151244K->126167K(1995584K), 0.7307550 secs]
            5318.847: [Full GC 324482K->112341K(1995584K), 0.8881160 secs]
            5379.753: [Full GC 150981K->120426K(1995584K), 0.7347590 secs]
            5440.497: [Full GC 138002K->120571K(1995584K), 0.7073100 secs]
            5501.219: [Full GC 162701K->121154K(1995584K), 0.8106100 secs]
            5562.043: [Full GC 187542K->116383K(1995584K), 0.8410330 secs]
            5622.899: [Full GC 128962K->116492K(1995584K), 0.7064320 secs]
            5683.623: [Full GC 141898K->116778K(1995584K), 0.7193180 secs]
            5744.356: [Full GC 140333K->116938K(1995584K), 0.7225270 secs]
            5805.089: [Full GC 174905K->115802K(1995584K), 0.8199760 secs]
            5865.914: [Full GC 146451K->116805K(1995584K), 0.7277510 secs]
            5926.644: [Full GC 149006K->117144K(1995584K), 0.7247630 secs]
            5987.374: [Full GC 198293K->167502K(1995584K), 0.7934040 secs]
            6048.174: [Full GC 190047K->140692K(1995584K), 0.8370140 secs]
            6109.014: [Full GC 198961K->141155K(1995584K), 0.7327080 secs]
            6169.764: [Full GC 161902K->141271K(1995584K), 0.7189370 secs]
            6230.506: [Full GC 170969K->141585K(1995584K), 0.7201880 secs]
            6291.243: [Full GC 158886K->141051K(1995584K), 0.8681400 secs]
            6352.117: [Full GC 153178K->141147K(1995584K), 0.7166900 secs]
            6412.849: [Full GC 155586K->141590K(1995584K), 0.7385570 secs]

            • 3. Re: where to set memory options mainly GC options to reclaim
              Peter Johnson Master

              Am I seeing correctly, you have the heap set to about 2GB?

              I don't like seeing that many Full GCs. The earlier ones are probably due to the server making System.GC calls during startup, which is normal. But after 95.247 the Full GCs seem to be occuring about every 60 seconds, which is probably the distributed garbage collection (DGC) kicking in. You should set the DCG delay to a higher value. See slide Other JVM Options in the presentation I referenced earlier.

              Also, what is the full command line you gave to JBoss? Most of the Full GCs are dumping a lot of objects into the tenured generation. Based on this observation, I would guess that either your young generation size is way too small for the heap size you specified, or the tenuring threshold is set too low. Are you possibly using the concurrent garbage collector?

              References:
              http://java.sun.com/docs/hotspot/gc1.4.2/
              http://java.sun.com/docs/hotspot/gc5.0/gc_tuning_5.html