JDK-8320916 : jdk/jfr/event/gc/stacktrace/TestParallelMarkSweepAllocationPendingStackTrace.java failed with "OutOfMemoryError: GC overhead limit exceeded"
  • Type: Bug
  • Component: hotspot
  • Sub-Component: jfr
  • Affected Version: 22
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: os_x
  • CPU: x86_64
  • Submitted: 2023-11-28
  • Updated: 2025-02-21
  • Resolved: 2023-11-30
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.
JDK 11 JDK 17 JDK 21 JDK 22
11.0.27Fixed 17.0.15Fixed 21.0.7Fixed 22 b27Fixed
Related Reports
Relates :  
Description
The following test failed in the JDK22 CI:

jdk/jfr/event/gc/stacktrace/TestParallelMarkSweepAllocationPendingStackTrace.java

Here's a snippet from the log file:

#section:main
----------messages:(7/558)----------
command: main -XX:MaxNewSize=10M -Xmx64M -XX:+UseParallelGC -Xlog:gc* jdk.jfr.event.gc.stacktrace.TestParallelMarkSweepAllocationPendingStackTrace
reason: User specified action: run main/othervm -XX:MaxNewSize=10M -Xmx64M -XX:+UseParallelGC -Xlog:gc* jdk.jfr.event.gc.stacktrace.TestParallelMarkSweepAllocationPendingStackTrace 
started: Tue Nov 28 14:42:35 GMT 2023
Mode: othervm [/othervm specified]
Additional options from @modules: --add-modules jdk.jfr,java.management,jdk.management
finished: Tue Nov 28 14:42:38 GMT 2023
elapsed time (seconds): 3.116
----------configuration:(3/66)----------

<snip>

[3.047s][info][gc,heap        ] GC(55) PSYoungGen: 4096K(7168K)->2394K(7168K) Eden: 4096K(4096K)->2394K(4096K) From: 0K(3072K)->0K(3072K)
[3.047s][info][gc,heap        ] GC(55) ParOldGen: 54863K(55296K)->54894K(55296K)
[3.047s][info][gc,metaspace   ] GC(55) Metaspace: 6549K(6912K)->6547K(6912K) NonClass: 5863K(6080K)->5861K(6080K) Class: 685K(832K)->685K(832K)
[3.047s][info][gc             ] GC(55) Pause Full (Ergonomics) 57M->55M(61M) 30.770ms
[3.047s][info][gc,cpu         ] GC(55) User=0.05s Sys=0.00s Real=0.03s
[3.059s][info][gc,heap,exit   ] Heap
[3.059s][info][gc,heap,exit   ]  PSYoungGen      total 7168K, used 2621K [0x00000007ff600000, 0x0000000800000000, 0x0000000800000000)
[3.059s][info][gc,heap,exit   ]   eden space 4096K, 63% used [0x00000007ff600000,0x00000007ff88f440,0x00000007ffa00000)
[3.059s][info][gc,heap,exit   ]   from space 3072K, 0% used [0x00000007ffa00000,0x00000007ffa00000,0x00000007ffd00000)
[3.059s][info][gc,heap,exit   ]   to   space 3072K, 0% used [0x00000007ffd00000,0x00000007ffd00000,0x0000000800000000)
[3.059s][info][gc,heap,exit   ]  ParOldGen       total 55296K, used 54894K [0x00000007fc000000, 0x00000007ff600000, 0x00000007ff600000)
[3.059s][info][gc,heap,exit   ]   object space 55296K, 99% used [0x00000007fc000000,0x00000007ff59ba90,0x00000007ff600000)
[3.059s][info][gc,heap,exit   ]  Metaspace       used 6601K, committed 6976K, reserved 1114112K
[3.059s][info][gc,heap,exit   ]   class space    used 696K, committed 896K, reserved 1048576K
----------System.err:(38/2923)----------
java.lang.OutOfMemoryError: GC overhead limit exceeded
	at java.base/jdk.internal.util.ReferencedKeyMap.lookupKey(ReferencedKeyMap.java:176)
	at java.base/jdk.internal.util.ReferencedKeyMap.get(ReferencedKeyMap.java:209)
	at java.base/jdk.internal.util.ReferencedKeySet.get(ReferencedKeySet.java:173)
	at java.base/java.lang.invoke.MethodType.makeImpl(MethodType.java:401)
	at java.base/java.lang.invoke.MethodType.methodType(MethodType.java:382)
	at java.base/java.lang.invoke.MethodTypeForm.canonicalize(MethodTypeForm.java:253)
	at java.base/java.lang.invoke.MethodTypeForm.findForm(MethodTypeForm.java:220)
	at java.base/java.lang.invoke.MethodType.makeImpl(MethodType.java:416)
	at java.base/java.lang.invoke.MethodType.methodType(MethodType.java:382)
	at java.base/java.lang.invoke.MethodType.changeReturnType(MethodType.java:704)
	at java.base/java.lang.invoke.InnerClassLambdaMetafactory.<init>(InnerClassLambdaMetafactory.java:174)
	at java.base/java.lang.invoke.LambdaMetafactory.metafactory(LambdaMetafactory.java:336)
	at java.base/java.lang.invoke.DirectMethodHandle$Holder.invokeStatic(DirectMethodHandle$Holder)
	at java.base/java.lang.invoke.Invokers$Holder.invokeExact_MT(Invokers$Holder)
	at java.base/java.lang.invoke.BootstrapMethodInvoker.invoke(BootstrapMethodInvoker.java:134)
	at java.base/java.lang.invoke.CallSite.makeSite(CallSite.java:316)
	at java.base/java.lang.invoke.MethodHandleNatives.linkCallSiteImpl(MethodHandleNatives.java:275)
	at java.base/java.lang.invoke.MethodHandleNatives.linkCallSite(MethodHandleNatives.java:265)
	at jdk.jfr/jdk.jfr.internal.consumer.ConstantMap.resolve(ConstantMap.java:131)
	at jdk.jfr/jdk.jfr.internal.consumer.ChunkParser.lambda$new$2(ChunkParser.java:143)
	at jdk.jfr/jdk.jfr.internal.consumer.ChunkParser$$Lambda/0x00000001250adc58.accept(Unknown Source)
	at jdk.jfr/jdk.jfr.internal.LongMap.forEach(LongMap.java:246)
	at jdk.jfr/jdk.jfr.internal.consumer.ChunkParser.<init>(ChunkParser.java:143)
	at jdk.jfr/jdk.jfr.internal.consumer.ChunkParser.<init>(ChunkParser.java:109)
	at jdk.jfr/jdk.jfr.internal.consumer.ChunkParser.<init>(ChunkParser.java:105)
	at jdk.jfr/jdk.jfr.consumer.RecordingFile.createChunkParser(RecordingFile.java:318)
	at jdk.jfr/jdk.jfr.consumer.RecordingFile.findNext(RecordingFile.java:294)
	at jdk.jfr/jdk.jfr.consumer.RecordingFile.<init>(RecordingFile.java:89)
	at jdk.jfr/jdk.jfr.consumer.RecordingFile.readAllEvents(RecordingFile.java:271)
	at jdk.test.lib.jfr.Events.fromRecording(Events.java:275)
	at jdk.jfr.event.gc.stacktrace.AllocationStackTrace.allocAndCheck(AllocationStackTrace.java:386)
	at jdk.jfr.event.gc.stacktrace.AllocationStackTrace.testAllocEvent(AllocationStackTrace.java:343)

JavaTest Message: Test threw exception: java.lang.OutOfMemoryError: GC overhead limit exceeded
JavaTest Message: shutting down test

STATUS:Failed.`main' threw exception: java.lang.OutOfMemoryError: GC overhead limit exceeded
----------rerun:(41/8701)*----------
Comments
A pull request was submitted for review. Branch: master URL: https://git.openjdk.org/jdk11u-dev/pull/2976 Date: 2024-12-12 03:11:41 +0000
12-12-2024

A pull request was submitted for review. Branch: master URL: https://git.openjdk.org/jdk17u-dev/pull/3109 Date: 2024-12-12 03:09:23 +0000
12-12-2024

A pull request was submitted for review. Branch: master URL: https://git.openjdk.org/jdk21u-dev/pull/1224 Date: 2024-12-12 03:09:21 +0000
12-12-2024

[jdk21u-fix-request] Approval Request from sendaoYan Test bug fix to make test more robustness, test-fix only, no risk.
12-12-2024

[jdk11u-fix-request] Approval Request from sendaoYan Test bug fix to make test more robustness, test-fix only, no risk.
12-12-2024

[jdk17u-fix-request] Approval Request from sendaoYan Test bug fix to make test more robustness, test-fix only, no risk.
12-12-2024

The fix for this bug is integrated in jdk-22+27-2131.
30-11-2023

Changeset: 69384745 Author: Albert Mingkun Yang <ayang@openjdk.org> Date: 2023-11-30 15:48:00 +0000 URL: https://git.openjdk.org/jdk/commit/693847452f208446a34186f142fe2c56a49ceceb
30-11-2023

A pull request was submitted for review. URL: https://git.openjdk.org/jdk/pull/16870 Date: 2023-11-29 00:35:47 +0000
29-11-2023

JDK-8319713 removes the too-conservative Full GC, so this test needs to allocate a bit more to trigger a Full GC, which leaves less free memory for collecting and verifying jfr events. A easy fix is to reduce the live set.
28-11-2023