OutOfMemory error is not thrown in the following case:
assertEval("import java.util.*;");
assertEval("List<byte[]> list = new ArrayList<>();");
assertExecuteException("while (true) { list.add(new byte[10000]); }", OutOfMemoryError.class);
If 10000 is replaced with 100000, the error occurs.
See ExceptionsTest#outOfMemory
assertEval("import java.util.*;");
assertEval("List<byte[]> list = new ArrayList<>();");
assertExecuteException("while (true) { list.add(new byte[10000]); }", OutOfMemoryError.class);
If 10000 is replaced with 100000, the error occurs.
See ExceptionsTest#outOfMemory
- duplicates
-
JDK-8132147 JShell tool: jshell does not print stack trace for OutOfMemoryError
-
- Closed
-