8337550: Add documentation to TestOutOfMemoryDuringInit.java

Reviewed-by: dholmes
This commit is contained in:
Albert Mingkun Yang 2024-08-01 07:28:39 +00:00
parent cf1230a5f7
commit 8eb56845e4

View File

@ -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());
}
}