From 8eb56845e46e8e4867915c8c079adfe1196dcbbc Mon Sep 17 00:00:00 2001 From: Albert Mingkun Yang Date: Thu, 1 Aug 2024 07:28:39 +0000 Subject: [PATCH] 8337550: Add documentation to TestOutOfMemoryDuringInit.java Reviewed-by: dholmes --- .../runtime/ClassInitErrors/TestOutOfMemoryDuringInit.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test/hotspot/jtreg/runtime/ClassInitErrors/TestOutOfMemoryDuringInit.java b/test/hotspot/jtreg/runtime/ClassInitErrors/TestOutOfMemoryDuringInit.java index 1001ede5447..2f8d0fee721 100644 --- a/test/hotspot/jtreg/runtime/ClassInitErrors/TestOutOfMemoryDuringInit.java +++ b/test/hotspot/jtreg/runtime/ClassInitErrors/TestOutOfMemoryDuringInit.java @@ -44,6 +44,10 @@ public class TestOutOfMemoryDuringInit { static void forceInit() { } static { while (theList != null) { + // Use the minimal allocation size to push heap occupation to + // the limit, ensuring there is not enough memory to create the + // ExceptionInInitializerError that the VM tries to create when + // the clinit throws the OOM. theList.add(new Object()); } }