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

G1 Full GC does not always slide memory to bottom addresses

XMLWordPrintable

    • gc
    • b07
    • x86_64
    • linux

      The following test failed in the JDK18 CI:

      runtime/cds/appcds/cacheObject/HeapFragmentationTest.java

      Here's a snippet from the log file:

      [0.625s][info ][gc,heap] GC(4) Eden regions: 0->0(2)
      [0.625s][info ][gc,heap] GC(4) Survivor regions: 0->0(5)
      [0.625s][info ][gc,heap] GC(4) Old regions: 1->1
      [0.625s][info ][gc,heap] GC(4) Archive regions: 2->2
      [0.625s][info ][gc,heap] GC(4) Humongous regions: 0->0
      [0.625s][info ][gc ] GC(4) Pause Full (G1 Compaction Pause) 1M->1M(10M) 71.992ms
      Aborting due to java.lang.OutOfMemoryError: Java heap space
      # To suppress the following error report, specify this argument
      # after -XX: or in .hotspotrc: SuppressErrorAt=/debug.cpp:362
      #
      # A fatal error has been detected by the Java Runtime Environment:
      #
      # Internal Error (/opt/mach5/mesos/work_dir/slaves/ff806ead-2cac-495d-9cbc-62116f99bf14-S13740/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/ab608f54-4d8f-478e-83ac-d19b2e323bdb/runs/0b06b07a-ea51-4623-af6d-c2d4ba24de47/workspace/open/src/hotspot/share/utilities/debug.cpp:362), pid=17819, tid=17823
      # fatal error: OutOfMemory encountered: Java heap space
      #
      # JRE version: Java(TM) SE Runtime Environment (18.0+30) (fastdebug build 18-ea+30-2014)
      # Java VM: Java HotSpot(TM) 64-Bit Server VM (fastdebug 18-ea+30-2014, mixed mode, sharing, tiered, compressed oops, compressed class ptrs, g1 gc, linux-amd64)
      # Core dump will be written. Default location: Core dumps may be processed with "/opt/core.sh %p" (or dumping to /opt/mach5/mesos/work_dir/slaves/ff806ead-2cac-495d-9cbc-62116f99bf14-S14144/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/394d1899-59ec-4632-9797-dfcc5aae96c5/runs/57a2ffc5-f654-472a-8132-39ff1cdd676a/testoutput/test-support/jtreg_open_test_hotspot_jtreg_hotspot_cds_relocation/scratch/3/core.17819)
      #
      # An error report file with more information is saved as:
      # /opt/mach5/mesos/work_dir/slaves/ff806ead-2cac-495d-9cbc-62116f99bf14-S14144/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/394d1899-59ec-4632-9797-dfcc5aae96c5/runs/57a2ffc5-f654-472a-8132-39ff1cdd676a/testoutput/test-support/jtreg_open_test_hotspot_jtreg_hotspot_cds_relocation/scratch/3/hs_err_pid17819.log
      ];
       stderr: [java version "18-ea" 2022-03-22
      Java(TM) SE Runtime Environment (fastdebug build 18-ea+30-2014)
      Java HotSpot(TM) 64-Bit Server VM (fastdebug build 18-ea+30-2014, mixed mode, sharing)
      ]
       exitValue = 134

      java.lang.RuntimeException: 'array.length = 1048576000' missing from stdout/stderr

      at jdk.test.lib.process.OutputAnalyzer.shouldContain(OutputAnalyzer.java:221)
      at jdk.test.lib.cds.CDSTestUtils.checkMatches(CDSTestUtils.java:491)
      at jdk.test.lib.cds.CDSTestUtils$Result.assertNormalExit(CDSTestUtils.java:194)
      at HeapFragmentationTest.main(HeapFragmentationTest.java:85)
      at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
      at java.base/java.lang.reflect.Method.invoke(Method.java:577)
      at com.sun.javatest.regtest.agent.MainActionHelper$AgentVMRunnable.run(MainActionHelper.java:312)
      at java.base/java.lang.Thread.run(Thread.java:833)

      JavaTest Message: Test threw exception: java.lang.RuntimeException
      JavaTest Message: shutting down test

      result: Failed. Execution failed: `main' threw exception: java.lang.RuntimeException: 'array.length = 1048576000' missing from stdout/stderr

      Here's the crashing thread's stack:

      --------------- T H R E A D ---------------

      Current thread (0x00007f98a0037620): JavaThread "main" [_thread_in_vm, id=17823, stack(0x00007f98a841f000,0x00007f98a8520000)]

      Stack: [0x00007f98a841f000,0x00007f98a8520000], sp=0x00007f98a851e2e0, free space=1020k
      Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
      V [libjvm.so+0x1a1bf00] VMError::report_and_die(int, char const*, char const*, __va_list_tag*, Thread*, unsigned char*, void*, void*, char const*, int, unsigned long)+0x1a0
      V [libjvm.so+0xaf4d5b] report_fatal(VMErrorType, char const*, int, char const*, ...)+0x12b
      V [libjvm.so+0xaf500d] report_java_out_of_memory(char const*)+0xed
      V [libjvm.so+0x14b1c1a] MemAllocator::Allocation::check_out_of_memory()+0xda
      V [libjvm.so+0x14b48e1] MemAllocator::allocate() const+0x191
      V [libjvm.so+0x1968c86] TypeArrayKlass::allocate_common(int, bool, JavaThread*)+0x2e6
      V [libjvm.so+0x15ea06f] oopFactory::new_typeArray(BasicType, int, JavaThread*)+0xff
      V [libjvm.so+0xeed4d6] InterpreterRuntime::newarray(JavaThread*, BasicType, int)+0xb6
      j HeapFragmentationApp.main([Ljava/lang/String;)V+20
      v ~StubRoutines::call_stub
      V [libjvm.so+0xf07434] JavaCalls::call_helper(JavaValue*, methodHandle const&, JavaCallArguments*, JavaThread*)+0x504
      V [libjvm.so+0x1040b75] jni_invoke_static(JNIEnv_*, JavaValue*, _jobject*, JNICallType, _jmethodID*, JNI_ArgumentPusher*, JavaThread*) [clone .constprop.1]+0x375
      V [libjvm.so+0x10441b5] jni_CallStaticVoidMethod+0x1c5
      C [libjli.so+0x4797] JavaMain+0xd37
      C [libjli.so+0x7aa9] ThreadJavaMain+0x9

      Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
      j HeapFragmentationApp.main([Ljava/lang/String;)V+20
      v ~StubRoutines::call_stub

            tschatzl Thomas Schatzl
            dcubed Daniel Daugherty
            Votes:
            0 Vote for this issue
            Watchers:
            9 Start watching this issue

              Created:
              Updated:
              Resolved: