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

The test gc/g1/TestHumongousShrinkHeap.java reports that memory is not de-committed

XMLWordPrintable

    • gc

      The test gc/g1/TestHumongousShrinkHeap.java allocates several groups of humongous objects and then frees those which were allocated first.
      It expects, that g1 will give some committed memory back to the system. But it doesn't.

      The output from the test:
      command: main -XX:MinHeapFreeRatio=10 -XX:MaxHeapFreeRatio=50 -XX:+UseG1GC -XX:G1HeapRegionSize=1M -verbose:gc TestHumongousShrinkHeap
      reason: User specified action: run main/othervm -XX:MinHeapFreeRatio=10 -XX:MaxHeapFreeRatio=50 -XX:+UseG1GC -XX:G1HeapRegionSize=1M -verbose:gc TestHumongousShrinkHeap
      elapsed time (seconds): 1.029
      ----------System.out:(26/1632)----------
      [Full GC (System.gc()) 1210K->511K(8192K), 0.0368437 secs]
      [init ] init: 188.7 MB, used: 524.2 kB, comm: 8.4 MB , freeRatio ~= 93.8%
      Will allocate objects of size=943.7 kB
      [GC pause (G1 Humongous Allocation) (young) (initial-mark) 2519K->2451K(8192K), 0.0024301 secs]
      [GC concurrent-root-region-scan-start]
      [GC concurrent-root-region-scan-end, 0.0002982 secs]
      [GC concurrent-mark-start]
      [GC concurrent-mark-end, 0.0038288 secs]
      [GC remark, 0.0010866 secs]
      [GC cleanup 7059K->7059K(9216K), 0.0004442 secs]
      [GC pause (G1 Evacuation Pause) (young) 10M->10M(28M), 0.0017848 secs]
      [GC pause (G1 Humongous Allocation) (young) (initial-mark) 27M->27M(68M), 0.0020361 secs]
      [GC concurrent-root-region-scan-start]
      [GC concurrent-root-region-scan-end, 0.0004249 secs]
      [GC concurrent-mark-start]
      [GC concurrent-mark-end, 0.0038802 secs]
      [GC remark, 0.0013999 secs]
      [GC cleanup 33M->33M(68M), 0.0005887 secs]
      [eat #0 ] init: 188.7 MB, used: 95.0 MB, comm: 108.0 MB, freeRatio ~= 12.1%
      [eat #1 ] init: 188.7 MB, used: 189.3 MB, comm: 212.9 MB, freeRatio ~= 11.0%
      [eat #2 ] init: 188.7 MB, used: 283.7 MB, comm: 317.7 MB, freeRatio ~= 10.7%
      [eat #3 ] init: 188.7 MB, used: 378.1 MB, comm: 422.6 MB, freeRatio ~= 10.5%
      [eat #4 ] init: 188.7 MB, used: 472.5 MB, comm: 527.4 MB, freeRatio ~= 10.4%
      [eaten ] init: 188.7 MB, used: 472.5 MB, comm: 527.4 MB, freeRatio ~= 10.4%
      [Full GC (System.gc()) 451M->1438K(503M), 0.0196609 secs]
      [free ] init: 188.7 MB, used: 1.5 MB , comm: 527.4 MB, freeRatio ~= 99.7%
      ----------System.err:(21/1357)----------
      java.lang.RuntimeException: committed free heap size is not less than committed full heap size, heap hasn't been shrunk?
      MinHeapFreeRatio = 10
      MaxHeapFreeRatio = 50
      at com.oracle.java.testlibrary.Asserts.error(Asserts.java:450)
      at com.oracle.java.testlibrary.Asserts.assertTrue(Asserts.java:377)
      at com.oracle.java.testlibrary.Asserts.assertLessThan(Asserts.java:84)
      at TestHumongousShrinkHeap.test(TestHumongousShrinkHeap.java:65)
      at TestHumongousShrinkHeap.main(TestHumongousShrinkHeap.java:50)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:484)
      at com.sun.javatest.regtest.MainWrapper$MainThread.run(MainWrapper.java:94)
      at java.lang.Thread.run(Thread.java:744)

            azakharov Andrey Zakharov (Inactive)
            dfazunen Dmitry Fazunenko (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: