JDK-8343038 : C2: TestScalarReplacementMaxLiveNodes.java fails with fatal error: Hit MemLimit in escape analysis
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 23,24
  • Priority: P4
  • Status: Open
  • Resolution: Unresolved
  • Submitted: 2024-10-25
  • Updated: 2024-10-25
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
tbdUnresolved
Related Reports
Relates :  
Relates :  
Relates :  
Description
TestScalarReplacementMaxLiveNodes.java fails with fatal error: Hit MemLimit

V  [libjvm.so+0xa8bb45]  report_fatal(VMErrorType, char const*, int, char const*, ...)+0x105  (debug.cpp:214)
V  [libjvm.so+0x9bac4d]  CompilationMemoryStatistic::on_arena_change(long, Arena const*)+0x3fd  (compilationMemoryStatistic.cpp:559)
V  [libjvm.so+0x5ea69c]  Arena::grow(unsigned long, AllocFailStrategy::AllocFailEnum)+0x10c  (arena.cpp:299)
V  [libjvm.so+0x17e1227]  TypeInstPtr::make(TypePtr::PTR, ciKlass*, TypeInterfaces const*, bool, ciObject*, int, int, TypePtr const*, int)+0xc7  (type.hpp:198)
V  [libjvm.so+0x9c8d89]  Compile::flatten_alias_type(TypePtr const*) const+0xf89  (type.hpp:1337)
V  [libjvm.so+0x9c9a6b]  Compile::find_alias_type(TypePtr const*, bool, ciField*) [clone .part.0]+0x44b  (compile.cpp:1673)
V  [libjvm.so+0xba7c00]  ConnectionGraph::create_split_phi(PhiNode*, int, GrowableArray<PhiNode*>&, bool&)+0x3b0  (compile.hpp:955)
V  [libjvm.so+0xba8c60]  ConnectionGraph::split_memory_phi(PhiNode*, int, GrowableArray<PhiNode*>&)+0x70  (escape.cpp:3886)
V  [libjvm.so+0xba88d9]  ConnectionGraph::find_inst_mem(Node*, int, GrowableArray<PhiNode*>&)+0xa29  (escape.cpp:4181)
V  [libjvm.so+0xba8dde]  ConnectionGraph::split_memory_phi(PhiNode*, int, GrowableArray<PhiNode*>&)+0x1ee  (escape.cpp:3897)
V  [libjvm.so+0xba88d9]  ConnectionGraph::find_inst_mem(Node*, int, GrowableArray<PhiNode*>&)+0xa29  (escape.cpp:4181)
V  [libjvm.so+0xbad0d7]  ConnectionGraph::split_unique_types(GrowableArray<Node*>&, GrowableArray<ArrayCopyNode*>&, GrowableArray<MergeMemNode*>&, Unique_Node_List&)+0x3127  (escape.cpp:4782)
V  [libjvm.so+0xbb5c09]  ConnectionGraph::compute_escape()+0x2099  (escape.cpp:397)
V  [libjvm.so+0xbb63f1]  ConnectionGraph::do_analysis(Compile*, PhaseIterGVN*)+0xf1  (escape.cpp:119)
V  [libjvm.so+0x9e068a]  Compile::Optimize()+0x63a  (compile.cpp:2347)
V  [libjvm.so+0x9e4476]  Compile::Compile(ciEnv*, ciMethod*, int, Options, DirectiveSet*)+0x1af6  (compile.cpp:853)
Comments
Roland, could you please have a look?
25-10-2024

ILW = (Harmless) compilation memory limit reached, single test, no workaround but increase memory limit = MLH = P4
25-10-2024

I checked and this still reproduces with the fix for JDK-8324345: # A fatal error has been detected by the Java Runtime Environment: # # Internal Error (/workspace/open/src/hotspot/share/compiler/compilationMemoryStatistic.cpp:559), pid=499019, tid=499035 # fatal error: c2 compiler/c2/TestScalarReplacementMaxLiveNodes::test((IIIII)Ljava/lang/String;): Hit MemLimit (limit: 1073741824 now: 1073753992) # # JRE version: Java(TM) SE Runtime Environment (23.0.3) (fastdebug build 23.0.3-internal-2024-10-25-1022169.tobias.hartmann.jdk23u-cpu) # Java VM: Java HotSpot(TM) 64-Bit Server VM (fastdebug 23.0.3-internal-2024-10-25-1022169.tobias.hartmann.jdk23u-cpu, mixed mode, sharing, 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/ccd15758-3c17-44a6-a32a-40698b0633d8-S15101/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/cedf4f2c-aeb6-457f-8064-aa4ef21a66e1/runs/19ea1cdd-1e15-47e5-9378-daccf4c5a7a9/testoutput/test-support/jtreg_open_test_hotspot_jtreg_compiler_c2_TestScalarReplacementMaxLiveNodes_java/scratch/0/core.499019) Current CompileTask: C2:4359 15 !b compiler.c2.TestScalarReplacementMaxLiveNodes::test (1485 bytes) Stack: [0x00007fa9947b8000,0x00007fa9948b8000], sp=0x00007fa9948b1860, free space=998k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) V [libjvm.so+0x189b312] VMError::report_and_die(int, char const*, char const*, __va_list_tag*, Thread*, unsigned char*, void*, void*, char const*, int, unsigned long)+0x482 (compilationMemoryStatistic.cpp:559) V [libjvm.so+0xa8bb45] report_fatal(VMErrorType, char const*, int, char const*, ...)+0x105 (debug.cpp:214) V [libjvm.so+0x9bac4d] CompilationMemoryStatistic::on_arena_change(long, Arena const*)+0x3fd (compilationMemoryStatistic.cpp:559) V [libjvm.so+0x5ea69c] Arena::grow(unsigned long, AllocFailStrategy::AllocFailEnum)+0x10c (arena.cpp:299) V [libjvm.so+0x17e12a7] TypeInstPtr::make(TypePtr::PTR, ciKlass*, TypeInterfaces const*, bool, ciObject*, int, int, TypePtr const*, int)+0xc7 (type.hpp:198) V [libjvm.so+0x9c8d89] Compile::flatten_alias_type(TypePtr const*) const+0xf89 (type.hpp:1337) V [libjvm.so+0x9c9861] Compile::find_alias_type(TypePtr const*, bool, ciField*) [clone .part.0]+0x241 (compile.cpp:1682) V [libjvm.so+0xba7be0] ConnectionGraph::create_split_phi(PhiNode*, int, GrowableArray<PhiNode*>&, bool&)+0x3b0 (compile.hpp:955) V [libjvm.so+0xba8c9f] ConnectionGraph::split_memory_phi(PhiNode*, int, GrowableArray<PhiNode*>&, unsigned int)+0x6f (escape.cpp:3886) V [libjvm.so+0xba88c9] ConnectionGraph::find_inst_mem(Node*, int, GrowableArray<PhiNode*>&, unsigned int)+0xa39 (escape.cpp:4186) V [libjvm.so+0xba8e3b] ConnectionGraph::split_memory_phi(PhiNode*, int, GrowableArray<PhiNode*>&, unsigned int)+0x20b (escape.cpp:3897) V [libjvm.so+0xba88c9] ConnectionGraph::find_inst_mem(Node*, int, GrowableArray<PhiNode*>&, unsigned int)+0xa39 (escape.cpp:4186) V [libjvm.so+0xbad338] ConnectionGraph::split_unique_types(GrowableArray<Node*>&, GrowableArray<ArrayCopyNode*>&, GrowableArray<MergeMemNode*>&, Unique_Node_List&)+0x3328 (escape.cpp:4787) V [libjvm.so+0xbb5c89] ConnectionGraph::compute_escape()+0x2099 (escape.cpp:397) V [libjvm.so+0xbb6471] ConnectionGraph::do_analysis(Compile*, PhaseIterGVN*)+0xf1 (escape.cpp:119) V [libjvm.so+0x9e068a] Compile::Optimize()+0x63a (compile.cpp:2347) V [libjvm.so+0x9e4476] Compile::Compile(ciEnv*, ciMethod*, int, Options, DirectiveSet*)+0x1af6 (compile.cpp:853) V [libjvm.so+0x83a435] C2Compiler::compile_method(ciEnv*, ciMethod*, int, bool, DirectiveSet*)+0x1d5 (c2compiler.cpp:142) V [libjvm.so+0x9f0258] CompileBroker::invoke_compiler_on_method(CompileTask*)+0x928 (compileBroker.cpp:2303) V [libjvm.so+0x9f0ed8] CompileBroker::compiler_thread_loop()+0x468 (compileBroker.cpp:1961) V [libjvm.so+0xe9a50c] JavaThread::thread_main_inner()+0xcc (javaThread.cpp:759) V [libjvm.so+0x17b8476] Thread::call_run()+0xb6 (thread.cpp:225) V [libjvm.so+0x149f8f7] thread_native_entry(Thread*)+0x127 (os_linux.cpp:849) Lock stack of current Java thread (top to bottom):
25-10-2024

That looks like a regression from JDK-8340214 that changed the code in Compile::flatten_alias_type and went into the build that triggered this first. We don't hit this in JDK 24 because JDK-8342612 increased the memory limit for that test and that change was also just backported to JDK 23u so the failure will disappear there as well.
25-10-2024