4 Replies Latest reply on Mar 8, 2012 11:51 AM by ramboid

    Options for CMS and G1 Collectors

    ramboid

      Could you recommend settings for these two collectors that come wiht the SUN JVM?  I would like to try these two collectors in my application running in JBoss1.5 and JDK1.6_30.  I have four processors and about 16GB of total RAM so I am allocating a max heap of about 6GB.

       

      What would ther be the best settings to take advantage of the ergonomics of the JVM?  I am trying a few settings that minimize the promotion of objects to the tenured generation but I see very little promotion from the young to the tenured gens.  I thoguht that it would be a good idea to promote more objects to tenure and take advantage of the CMS collector.

        • 1. Re: Options for CMS and G1 Collectors
          peterj

          >>I thoguht that it would be a good idea to promote more objects to tenure and take advantage of the CMS collector.

           

          Actually, this is a bad idea based on testing that i haved done. Two reasons:

           

          1) The pauses during CMS and G1 collections (yes, there are pauses - two of them) are about as long as the pause caused by minor collection.

           

          2) While CMS and G1 run, they are using up one entire processor/core at 100% because they are memory and processor intensive. You want those collectors to run as rarely as possible. If you tenure every object that lives through a minor collection, then you are going to run CMS/G1 more often and thus will more often lose the use of a core to process business requests.

           

          See this white paper:

          Java Garbage Collection Performance Analysis 201

          at http://www.cmg.org/cgi-bin/search.cgi?q=java+peter+johnson&x=30&y=10

          (I worked with a beta version of G1, so take the stability warnings with a grain of salt)

          • 2. Re: Options for CMS and G1 Collectors
            ramboid

            Thank you for your quick reply Peter.  I was wondering if the article that you cite would have the latest command options for G1.  I tried some of the optionsthat worked in JDK1.6_14 but they seem to fail with JDK1.6_30.

             

            I am still tryign to log into the web site that shows your article.  Does your article delve into the details to take full advantage of the ergonomics of the newest versions of the JDK1.6?

            • 3. Re: Options for CMS and G1 Collectors
              peterj

              As I mentioned I worked with a beta version of G1 so the white paper (which was written in 2009) doesn't have the latest options. By the way, the white paper that discusses G1 is titled "Reducing Java Garbage Collection Pause Times" (it also covers CMS).

               

              Why are you trying to log onto the web site, you don't need to. The link show take you to a search results page that shows all of my white papers.

              • 4. Re: Options for CMS and G1 Collectors
                ramboid

                That article should be quite informative.  Clicking on the link does bring you to the page with a list of your papers but clicking on any of them brings you to a logon and registration page.