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

different num. of GCs between verbose:gc and mxbeans in 6.0b65

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: 5.0, 6
    • Fix Version/s: 6
    • Component/s: core-svc
    • Subcomponent:
    • Resolved In Build:
      b82
    • CPU:
      generic, x86
    • OS:
      generic, windows_xp

      Description

      When a user measure the num. of GCs, the result in verbose:gc and mxbeans seems different.

      REPRODUCING and BEHAVIOR:
      The attached test progtam, GCBeanTEST.java tries to allocate 4M memory 100 times.

      1) Compile the test program and invoke the following command line.
         java -Xms64m -XX:+UseSerialGC -XX:NewRatio=12 -verbose:gc GCBeanTEST
         NOTE:
            -XX:+UseSerialGC and -XX:NewRatio=12 is added to avoid that runtime system
            considers the PC as "server" machine.(to avoid auto-configuration)

      The following message will appear

      K:\shares2\gc>java -Xms64m -XX:+UseSerialGC -XX:NewRato=12 -verbose:gc GCBeanTEST
      [GC 285K->133K(65088K), 0.0046967 secs]
      [Full GC 133K->133K(65088K), 0.0156947 secs]
      [GC 4229K->4229K(65088K), 0.0006263 secs]
      [Full GC 4229K->133K(65088K), 0.0160146 secs]
      [GC 4229K->4229K(65088K), 0.0004048 secs]
      [Full GC 4229K->133K(65088K), 0.0281636 secs]
      [GC 4229K->4229K(65088K), 0.0003623 secs]
      [Full GC 4229K->133K(65088K), 0.0186784 secs]
      [GC 4229K->4229K(65088K), 0.0003084 secs]
      [Full GC 4229K->133K(65088K), 0.0153316 secs]
      ..........
      sun.management.GarbageCollectorImpl@82c01f, sun.management.GarbageCollectorImp
      @133796]

      ----- Copy -----
      sun.management.GarbageCollectorImpl@82c01f
      GarbageCollectorMXBean.getName():Copy
      GarbageCollectorMXBean.getCollectionCount():100
      GarbageCollectorMXBean.getCollectionTime():1962
      ------------------------------------

      ----- MarkSweepCompact -----
      sun.management.GarbageCollectorImpl@133796
      GarbageCollectorMXBean.getName():MarkSweepCompact
      GarbageCollectorMXBean.getCollectionCount():0
      GarbageCollectorMXBean.getCollectionTime():0
      ------------------------------------

      INVESTIGATION:
        The messages by -verbose:gc
      ...
       [GC 4229K->4229K(65088K), 0.0003084 secs]
       [Full GC 4229K->133K(65088K), 0.0153316 secs]
      ....
        says GC anf Full GC occurs 100 times respectively.
        However, messages by mxbeans shows that CopyGC occurs 100 times

         GarbageCollectorMXBean.getCollectionCount():100

        and FullGC(MarkSweepCompact) occurs "0" times.(FullGC does not occur.)

         GarbageCollectorMXBean.getCollectionCount():0

      ----- Copy -----
      sun.management.GarbageCollectorImpl@82c01f
      GarbageCollectorMXBean.getName():Copy
      GarbageCollectorMXBean.getCollectionCount():100
      GarbageCollectorMXBean.getCollectionTime():1962
      ------------------------------------

      ----- MarkSweepCompact -----
      sun.management.GarbageCollectorImpl@133796
      GarbageCollectorMXBean.getName():MarkSweepCompact
      GarbageCollectorMXBean.getCollectionCount():0
      GarbageCollectorMXBean.getCollectionTime():0
      ------------------------------------

      EXPECTED BEHAVIOR:
        FullGC seems to occur 100 times, but mxbeans says FullGC does not occur.
        hHose results shgould be the same.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                swamyv Swamy Venkataramanappa
                Reporter:
                tbaba Tadayuki Baba (Inactive)
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: