12 Replies Latest reply: Sep 14, 2004 1:39 PM by Lodge Monkey RSS

    Full GC  !!! Good or bad ?

    surajmundada Newbie

      Hi,

      I am using Jboss3.2.0_Tomcat4.1.24 as default configuration with Postgres 7.3.2. as backend

      I have deployed an EAR file and it is showing following output.

      09:59:21,912 INFO [Server] JBoss (MX MicroKernel) [3.2.1 (build: CVSTag=JBoss_3_2_1 date=200305041533)] Started in 2m:12s:473ms
      [GC 139932K->60361K(259648K), 0.0962967 secs]
      [Full GC 71182K->60349K(259648K), 0.9117409 secs]
      [Full GC 81754K->60546K(259648K), 0.9205952 secs]
      [Full GC 82881K->60787K(259648K), 0.9188238 secs]
      [Full GC 78974K->58898K(259648K), 1.2746601 secs]
      [Full GC 77276K->59032K(259648K), 0.8989938 secs]
      [Full GC 76394K->59132K(259648K), 0.9069396 secs]
      [Full GC[Unloading class sun.reflect.GeneratedMethodAccessor13]
      [Unloading class sun.reflect.GeneratedSerializationConstructorAccessor13]
      [Unloading class sun.reflect.GeneratedSerializationConstructorAccessor10]
      [Unloading class sun.reflect.GeneratedConstructorAccessor23]
      [Unloading class sun.reflect.GeneratedConstructorAccessor30]
      [Unloading class sun.reflect.GeneratedMethodAccessor10]
      ..
      ..
      ..
      ..

      I can't understand..why Garbage collection is occuring very frequently ?
      We are using quite a high end Solaris 9 SPARC machine with 2 GB RAM on which Jboss is running.

      Is it indication of any problem ?

      Regards,

      Suraj

        • 1. 3852649
          Lodge Monkey Newbie

          Author field in Forum (bb module) should not change after the thread has been started. But several times I have seen incorrect values in Last Post and/or Author fields.

          As of right now, there are 2 examples:

          http://www.jboss.org/index.html?module=bb&op=viewtopic&t=46415

          cooper started this thread, but the HTML generated for the listing in the index

          http://www.jboss.org/index.html?module=bb&op=viewforum&f=180

          shows dong203 as the originator:

          <tr>
           <td class="row1" align="center" valign="middle" width="20"><img src="modules/bb/templates/subSilver/images/folder_announce.gif" width="19" height="18" alt="No new posts" title="No new posts" /></td>
           <td class="row1" width="100%"><span class="topictitle"><b>Announcement:</b> <a href="index.html?module=bb&op=viewtopic&t=46415" class="topictitle">Nukes 1.0</a></span><span class="gensmall"><br />
           </span></td>
           <td class="row2" align="center" valign="middle"><span class="postdetails">9</span></td>
           <td class="row3" align="center" valign="middle"><span class="name"><a href="index.html?module=user&op=userinfo&uid=48127">dong203</a></span></td>
           <td class="row2" align="center" valign="middle"><span class="postdetails">931</span></td>
           <td class="row3Right" align="center" valign="middle" nowrap="nowrap"><span class="postdetails">Thu Apr 15, 2004 03:33 AM<br /><a href="index.html?module=user&op=userinfo&uid=45675">hxp</a> <a href="index.html?module=bb&op=viewtopic&p=3830710#3830710"><img src="modules/bb/templates/subSilver/images/icon_latest_reply.gif" alt="View latest post" title="View latest post" border="0"/></a></span></td>
           </tr>





          http://www.jboss.org/index.html?module=bb&op=viewtopic&t=44058


          dphiggs started the thread, but the HTML generated for the listing in the index

          http://www.jboss.org/index.html?module=bb&op=viewforum&f=163

          shows cooper as the originator:

          <tr>
           <td class="row1" align="center" valign="middle" width="20"><img src="modules/bb/templates/subSilver/images/folder.gif" width="19" height="18" alt="No new posts" title="No new posts" /></td>
           <td class="row1" width="100%"><span class="topictitle"><a href="index.html?module=bb&op=viewtopic&t=44058" class="topictitle">How does Nukes evalute statements like $ {config:siteName}?</a></span><span class="gensmall"><br />
           </span></td>
           <td class="row2" align="center" valign="middle"><span class="postdetails">3</span></td>
           <td class="row3" align="center" valign="middle"><span class="name"><a href="index.html?module=user&op=userinfo&uid=2539">cooper</a></span></td>
           <td class="row2" align="center" valign="middle"><span class="postdetails">73</span></td>
           <td class="row3Right" align="center" valign="middle" nowrap="nowrap"><span class="postdetails">Wed Apr 21, 2004 05:05 AM<br /><a href="index.html?module=user&op=userinfo&uid=45675">hxp</a> <a href="index.html?module=bb&op=viewtopic&p=3831721#3831721"><img src="modules/bb/templates/subSilver/images/icon_latest_reply.gif" alt="View latest post" title="View latest post" border="0"/></a></span></td>
           </tr>


          Note that the erroneous value is always the id of someone who did post on that thread.

          -- Howard

          • 2. Re: Full GC  !!! Good or bad ?
            David Tauzell Newbie

            What do you have for your -Xms and -Xmx settings?

            • 3. Re: Full GC  !!! Good or bad ?
              surajmundada Newbie

              Hi,

              Thanks for the reply.

              I didn't know about -Xms and -Xmx settings before this.

              I searched for that and learnt that they are JVM memory settings.

              I am using JDK 1.4.2_02 with default settings. ( How should I check default settings ? I saw the commands to set the -Xms and -Xmx values but no commands to see the default values )

              From all documents and discussions I read, it is clear that default memory settings are not suitable for something like JBoss application.

              What settings should I use ?

              Regards,

              Suraj

              • 4. 3848722
                cjain75 Newbie

                Hey Suraj,

                Make the following entries in your run.bat file of Jboss

                set JAVA_OPTS=%JAVA_OPTS% -server -Xms512m -Xmx512m -XX:MaxPermSize=512m -XX:+AggressiveHeap

                For more JVM Options Chk out on the Sun Web Site.
                http://java.sun.com/docs/hotspot/VMOptions.html

                Regards,
                Chetan.

                • 5. Re: Full GC  !!! Good or bad ?
                  Anil Saldhana Master

                  By default, Sun's JVM runs on 64MB. Full GC is bad for performance. Try to use the latest JDK.

                  • 6. Re: Full GC  !!! Good or bad ?
                    surajmundada Newbie

                    Hi,

                    My system make up is as follow:

                    System Configuration: Sun Microsystems sun4u Sun Enterprise 220R (2 X UltraSPARC-II 450MHz)
                    System clock frequency: 113 MHz
                    Memory size: 2048 Megabytes

                    Filesystem size used avail capacity Mounted on
                    swap 1.6G 168K 1.6G 1% /var/run
                    swap 1.6G 48K 1.6G 1% /tmp

                    ======= SOFTWARE ===========

                    Sendmail

                    Postgres Version 7.3.2

                    Apache 1.3.27 (Unix) mod_ssl/2.8.14 OpenSSL/0.9.7b

                    PHP Version 4.3.1

                    Java /usr/j2sdk1.4.2_03/bin/java

                    Corda50 /opt/Corda50

                    JBOSS /opt/jboss-3.2.1_tomcat-4.1.24

                    MySQL Version - 3.23.49

                    Oracle oci8 /oracleroot/app/oracle/product/8.1.7

                    ======= SOFTWARE ===========


                    Would allocating 512 MB of memory for JVM would be a good move ?

                    Regards,

                    Suraj

                    • 7. Re: Full GC  !!! Good or bad ?
                      Torben Jaeger Newbie

                      just a hint:

                      use jvmstat to see what's going on with your memory and start playing with the values:


                      http://developers.sun.com/dev/coolstuff/jvmstat/

                      ./jvmps
                      and
                      ./visualgc <processid>
                      does the trick.


                      • 8. Re: Full GC  !!! Good or bad ?
                        surajmundada Newbie

                        Hi,

                        Sorry for late reply.

                        I added following line in run.sh file.

                        JAVA_OPTS = $JAVA_OPTS -Xms512m -Xmx512m -XX:MaxPermSize=512m -XX:+AggressiveHeap


                        But when JBoss starts, it shows following environment.


                        /jboss-3.2.1_tomcat-4.1.24/bin/run.sh: JAVA_OPTS: not found
                        ================================================================================

                        JBoss Bootstrap Environment

                        JBOSS_HOME: /opt/jboss-3.2.1_tomcat-4.1.24

                        JAVA: /usr/j2sdk1.4.2_03/bin/java

                        JAVA_OPTS: -server -Xms256m -Xmx512m -verbosegc -Dprogram.name=run.sh

                        CLASSPATH: /opt/jboss-3.2.1_tomcat-4.1.24/bin/run.jar:/usr/j2sdk1.4.2_03/lib/tools.jar

                        ================================================================================

                        02:46:45,783 INFO [Server] Starting JBoss (MX MicroKernel)...
                        02:46:45,788 INFO [Server] Release ID: JBoss [Wonde


                        That means, new value for JAVA_OPTS is not working.

                        I added the line as follows:



                        # Setup JBoss sepecific properties
                        JAVA_OPTS="$JAVA_OPTS -Dprogram.name=$PROGNAME"
                        
                        # For Cygwin, switch paths to Windows format before running java
                        if $cygwin; then
                         JBOSS_HOME=`cygpath --path --windows "$JBOSS_HOME"`
                         JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"`
                         JBOSS_CLASSPATH=`cygpath --path --windows "$JBOSS_CLASSPATH"`
                        fi
                        
                        JAVA_OPTS = $JAVA_OPTS -Xms512m -Xmx512m -XX:MaxPermSize=512m -XX:+AggressiveHeap
                        


                        I am still facing the same problem.

                        Any help ?

                        Thanks & Regards,

                        Suraj

                        • 9. Re: Full GC  !!! Good or bad ?
                          Torben Jaeger Newbie

                          try

                          JAVA_OPTS="$JAVA_OPTS [youropts]"


                          • 10. Re: Full GC  !!! Good or bad ?
                            surajmundada Newbie

                            Hi,

                            This worked but the new problem is old JVM memory settings are not overwritten, as shown in the following environment:

                            ash-2.05$ /opt/jboss-3.2.1_tomcat-4.1.24/bin/run.sh: -: not found
                            ================================================================================
                            
                             JBoss Bootstrap Environment
                            
                             JBOSS_HOME: /opt/jboss-3.2.1_tomcat-4.1.24
                            
                             JAVA: /usr/j2sdk1.4.2_03/bin/java
                            
                             JAVA_OPTS: -server -Xms256m -Xmx512m -verbosegc -Dprogram.name=run.sh -Xms512m -Xmx512m -XX:MaxPermSize=512m -XX:+AggressiveHeap
                            
                             CLASSPATH: /opt/jboss-3.2.1_tomcat-4.1.24/bin/run.jar:/usr/j2sdk1.4.2_03/lib/tools.jar
                            
                            ================================================================================
                            
                            22:08:14,773 INFO [Server] Starting JBoss (MX MicroKernel)...
                            22:08:14,779 INFO [Server] Release ID: JBoss [WonderLand] 3.2.1 (build: CVSTag=JBoss_3_2_1


                            I also cross checked this with

                            bash-2.05$ ps -aef|grep java
                             root 5752 1 0 22:08:14 pts/2 2:31 /usr/j2sdk1.4.2_03/bin/java -server -Xms256m -Xmx512m -verbosegc -Dprogram.name
                             root 5925 1 0 Sep 16 ? 24:31 /usr/java/bin/java -Dviper.fifo.path=/var/run/smc898/boot.fifo -Xmx128m -Djava.
                             maxuser 5755 5623 0 22:13:45 pts/1 0:00 grep java
                            bash-2.05$


                            PID 5752 stands for JBoss.

                            What should I do next ?

                            Regards,

                            Suraj

                            • 11. Re: Full GC  !!! Good or bad ?
                              Adrian Brock Master

                              You have the configuration twice, probably also in run.conf?

                              FAQs are there for a reason:
                              http://java.sun.com/docs/hotspot/gc1.4.2/faq.html
                              Number 33

                              • 12. Re: Full GC  !!! Good or bad ?
                                surajmundada Newbie

                                Hi,

                                Thanks a lot for all the help.

                                things are going fine now.

                                I changed JAVA_OPTS in run.conf with all parameters which I was trying to update in run.sh file.

                                Also, "-XX:+DisableExplicitGC" option also seems to be working which I got from FAQs on JAVA as suggested by Adrian.

                                my JAVA_OPTS finally looks like

                                JAVA_OPTS="-server -Xms512m -Xmx512m -verbosegc -XX:+PrintGCDetails -XX:+DisableExplicitGC -XX:Max
                                PermSize=512m -XX:+AggressiveHeap"


                                FULL GC messages have stopped flashing. only

                                [GC 185088K->181933K(508928K), 0.3384651 secs]
                                [GC 189037K->26521K(505600K), 0.2031701 secs]
                                [GC 185753K->177241K(505600K), 0.1564887 secs]
                                [GC 183449K->24697K(505024K), 0.2648330 secs]
                                [GC 182777K->177109K(505024K), 0.1530459 secs]
                                [GC 183125K->23954K(504896K), 0.0878689 secs]
                                


                                statements are occuring. But I guess, that's going to happen in any case. Also, they don't occur frequently as was the earlier case.

                                Regards,

                                Suraj