Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6352819

-Xloggc in _JAVA_OPTIONS logs to garbage filename

XMLWordPrintable

    • b65
    • x86
    • linux

        FULL PRODUCT VERSION :
        java version "1.5.0_05"
        Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_05-b05)
        Java HotSpot(TM) Client VM (build 1.5.0_05-b05, mixed mode, sharing)


        ADDITIONAL OS VERSION INFORMATION :
        Linux xxx 2.6.13.1 #1 Sun Sep 18 00:30:39 BST 2005 i686 i686 i386 GNU/Linux (Red Hat Fedora Core 4)
        Linux xxx 2.4.21-27.0.2.EL #1 Wed Jan 12 23:46:37 EST 2005 i686 i686 i386 GNU/Linux (Red Hat Enterprise Linux ES release 3 )

        A DESCRIPTION OF THE PROBLEM :
        The -Xloggc:filename option does not work when used from the _JAVA_OPTIONS environment variable. Sometimes, it is simply ignored, and the GC log appears on the console. Sometimes, the GC log is logged, but to a file with a filename consisting of random characters.

        STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
        $ ls
        HelloWorld.java
        $ _JAVA_OPTIONS="-Xloggc:gc" javac HelloWorld.java
        Picked up _JAVA_OPTIONS: -Xloggc:gc
        0.000: [GC 512K->157K(8128K), 0.0162910 secs]
        [....]

        Or sometimes:

        $ ls
        HelloWorld.java
        $ _JAVA_OPTIONS="-Xloggc:gc" javac HelloWorld.java
        Picked up _JAVA_OPTIONS: -Xloggc:gc
        $ ls
        HelloWorld.class HelloWorld.java ??Ò¿??Ò¿t?Ò¿???DP??D
        $ cat *D
        0.000: [GC 512K->157K(8128K), 0.0088680 secs]
        [...]

        EXPECTED VERSUS ACTUAL BEHAVIOR :
        EXPECTED -
        The -Xlogg:gc should cause the GC log to be recorded to the file gc when used in _JAVA_OPTIONS, just as when used on the command line.
        ACTUAL -
        See above.

        REPRODUCIBILITY :
        This bug can be reproduced always.

        ---------- BEGIN SOURCE ----------
        The HelloWorld.java code referred to above is not relevant to the problem, but for completeness:

        HelloWorld.java:
        public class HelloWorld {
            public static void main(String[] args) {
                System.out.println("Hello, World!");
            }
        }

        ---------- END SOURCE ----------

        CUSTOMER SUBMITTED WORKAROUND :
        Put -Xloggc options on the command line. However, this prevents JDK1.5 being a drop-in replacement for JDK1.4.2.

              kamg Keith Mcguigan (Inactive)
              ndcosta Nelson Dcosta (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: