1 2 Previous Next 17 Replies Latest reply: Jan 17, 2013 11:20 AM by EJP RSS

    GC Log rotation

    977816
      It seems that there are some GC arguments for GC log file rotation

      -Xloggc:/opt/apps/Test/logs/gc.log
      -XX:+UseGCLogFileRotation
      -XX:NumberOfGClogFiles=5
      -XX:GCLogFileSize=1K

      but when using these, I get unrecognized keywords messages.

      Are these officially support and yes in whcih releases? I'm using JDK 1.6.0_37

      Walter
        • 1. Re: GC Log rotation
          EJP
          It seems that there are some GC arguments for GC log file rotation
          It seems how? Where? Who said?
          but when using these, I get unrecognized keywords messages.
          So it seems there aren't any such GC arguments.
          • 2. Re: GC Log rotation
            977816
            http://stackoverflow.com/questions/3822097/rolling-garbage-collector-logs-in-java
            • 3. Re: GC Log rotation
              gimbal2
              974813 wrote:
              Are these officially support and yes in whcih releases? I'm using JDK 1.6.0_37
              Are you sure the runtime being used is also that version? Run java -version
              • 4. Re: GC Log rotation
                977816
                Yes

                bambood 30887 30862 99 10:49 ? 00:00:07 */opt/jdk1.6.0_37/jre/bin/java* -Xms64m -Xmx256m -XX:MaxPermSize=64m -verbose:gc -Xloggc:/opt/apps/Test/logs/gc.log -XX:+PrintGCDateStamps -XX:+PrintGCTimeStamps -XX:+PrintGCDetails -XX:+PrintHeapAtGC -XX:+PrintCommandLineFlags -XX:+UseConcMarkSweepGC -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/opt/apps/Test/heapdump -Djetty.home=/opt/jetty-distribution-7.6.8.v20121106 -Djetty.home=/opt/jetty-distribution-7.6.8.v20121106 -Djava.io.tmpdir=/opt/apps/Test/work -Djetty.rmiport=10050 -DSTOP.KEY=secret -DSTOP.PORT=10002 -Djetty.port=10000 -Dconfig.home=/opt/apps/Test -Drun.environment=dev -Djetty.logs=/opt/apps/Test/logs -cp /opt/jetty-distribution-7.6.8.v20121106/lib/jetty-xml-7.6.8.v20121106.jar:/opt/jetty-distribution-7.6.8.v20121106/lib/servlet-api-2.5.jar:/opt/jetty-distribution-7.6.8.v20121106/lib/jetty-http-7.6.8.v20121106.jar:/opt/jetty-distribution-7.6.8.v20121106/lib/jetty-continuation-7.6.8.v20121106.jar:/opt/jetty-distribution-7.6.8.v20121106/lib/jetty-server-7.6.8.v20121106.jar:/opt/jetty-distribution-7.6.8.v20121106/lib/jetty-security-7.6.8.v20121106.jar:/opt/jetty-distribution-7.6.8.v20121106/lib/jetty-servlet-7.6.8.v20121106.jar:/opt/jetty-distribution-7.6.8.v20121106/lib/jetty-webapp-7.6.8.v20121106.jar:/opt/jetty-distribution-7.6.8.v20121106/lib/jetty-deploy-7.6.8.v20121106.jar:/opt/jetty-distribution-7.6.8.v20121106/lib/jetty-servlets-7.6.8.v20121106.jar:/opt/jetty-distribution-7.6.8.v20121106/lib/ext/commons-dbcp-1.4.jar:/opt/jetty-distribution-7.6.8.v20121106/lib/ext/commons-pool-1.6.jar:/opt/jetty-distribution-7.6.8.v20121106/lib/ext/db2jcc_license_cisuz.jar:/opt/jetty-distribution-7.6.8.v20121106/lib/ext/db2jcc.jar:/opt/jetty-distribution-7.6.8.v20121106/lib/jetty-jmx-7.6.8.v20121106.jar:/opt/jetty-distribution-7.6.8.v20121106/lib/jsp/com.sun.el-1.0.0.v201105211818.jar:/opt/jetty-distribution-7.6.8.v20121106/lib/jsp/javax.el-2.1.0.v201105211819.jar:/opt/jetty-distribution-7.6.8.v20121106/lib/jsp/javax.servlet.jsp.jstl-1.2.0.v201105211821.jar:/opt/jetty-distribution-7.6.8.v20121106/lib/jsp/javax.servlet.jsp-2.1.0.v201105211820.jar:/opt/jetty-distribution-7.6.8.v20121106/lib/jsp/org.apache.jasper.glassfish-2.1.0.v201110031002.jar:/opt/jetty-distribution-7.6.8.v20121106/lib/jsp/org.apache.taglibs.standard.glassfish-1.2.0.v201112081803.jar:/opt/jetty-distribution-7.6.8.v20121106/lib/jsp/org.eclipse.jdt.core-3.7.1.jar:/opt/jetty-distribution-7.6.8.v20121106/resources:/opt/jetty-distribution-7.6.8.v20121106/lib/jetty-websocket-7.6.8.v20121106.jar:/opt/jetty-distribution-7.6.8.v20121106/lib/jetty-util-7.6.8.v20121106.jar:/opt/jetty-distribution-7.6.8.v20121106/lib/jetty-io-7.6.8.v20121106.jar org.eclipse.jetty.xml.XmlConfiguration /opt/apps/Test/work/start5527298765159936889.properties /opt/apps/common/etc-7/jetty-logging.xml /opt/apps/common/etc-7/jetty.xml /opt/apps/common/etc-7/jetty-requestlog.xml /opt/apps/common/etc-7/jetty-deploy.xml /opt/apps/common/etc-7/jetty-webapps.xml /opt/apps/common/etc-7/jetty-contexts.xml /opt/apps/common/etc-7/jetty-jmx.xml
                • 5. Re: GC Log rotation
                  Tolls
                  Here's the RFE:
                  http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6941923
                  Here'e the Bug Fix list for 6u34, which contains this:
                  http://www.oracle.com/technetwork/java/javase/2col/6u34-bugfixes-1733379.html

                  Can you copy the exact error message you are getting?
                  • 6. Re: GC Log rotation
                    977816
                    By adding

                    -XX:+UseGCLogFileRotation
                    -XX:NumberOfGClogFiles=5
                    -XX:GCLogFileSize=1K

                    Establishing start.log on Tue Dec 04 11:14:15 CET 2012
                    Unrecognized VM option 'NumberOfGClogFiles=5'
                    Could not create the Java virtual machine.
                    • 7. Re: GC Log rotation
                      Tolls
                      Are you sure your JRE is >= 6u34?

                      You might have a JDK > that, but I would now be questioning whether the JRE is.
                      • 8. Re: GC Log rotation
                        977816
                        Downloaded the jdk-6u37-linux-x64.bin from Oracle Java download an dusing this one
                        • 9. Re: GC Log rotation
                          Tolls
                          974813 wrote:
                          Downloaded the jdk-6u37-linux-x64.bin from Oracle Java download an dusing this one
                          That does not mean that is the JRE you are using.

                          I have no idea how you are running this, so can't say how you need ot check what version you are using.
                          • 10. Re: GC Log rotation
                            977816
                            Created small Java HelloWorld application

                            #!/usr/bin/ksh
                            export JAVA_HOME=/opt/jdk1.6.0_37
                            export PATH=$JAVA_HOME/bin:$PATH
                            java -version
                            java -Xloggc:./gc.log -XX:+UseGCLogFileRotation -XX:NumberOfGClogFiles=5 -XX:GCLogFileSize=1K HelloWorld

                            Running the application:

                            [root@lxj2ed01 HelloWorld]# ./HelloWorld.sh
                            java version "1.6.0_37"
                            Java(TM) SE Runtime Environment (build 1.6.0_37-b06)
                            Java HotSpot(TM) 64-Bit Server VM (build 20.12-b01, mixed mode)
                            Unrecognized VM option 'NumberOfGClogFiles=5'
                            Could not create the Java virtual machine.
                            • 11. Re: GC Log rotation
                              Tolls
                              OK, one last shot.
                              Try it with a capital L for Log:
                              -XX:NumberOfGCLogFiles=5

                              Just looking at the checkin logs and the text in there seems to be spelled as above.
                              http://hg.openjdk.java.net/hsx/hotspot-rt/hotspot/rev/2a241e764894
                              (Down near the end).

                              I would say there's a typo in the Bug info.
                              • 12. Re: GC Log rotation
                                977816
                                java -Xloggc:./gc.log -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=10 -XX:GCLogFileSize=50M HelloWorld

                                [root@lxj2ed01 HelloWorld]# ./HelloWorld.sh
                                java version "1.6.0_37"
                                Java(TM) SE Runtime Environment (build 1.6.0_37-b06)
                                Java HotSpot(TM) 64-Bit Server VM (build 20.12-b01, mixed mode)
                                This is HelloWorld application!

                                So, this was the issue at the end, the articles I found were using incorrect argument name
                                • 13. Re: GC Log rotation
                                  Tolls
                                  974813 wrote:
                                  So, this was the issue at the end, the articles I found were using incorrect argument name
                                  So is the solution text supplied in the bug...which is not too good.

                                  At least we found an answer I suppose!
                                  • 14. Re: GC Log rotation
                                    977816
                                    Yes, is answered.
                                    1 2 Previous Next