When an exception handler for an OutOfMemoryError uses string concatenation to 
compose an exception message, the invoke dynamic string format implementation 
may itself exhaust memory, preventing the exception from being handled.
Explicit use of String.concat() call can improve exception handling.

Writing a test of the exact failure condition has proved challenging due to the 
unpredictable state of memory when OOME occurs. The replacement of "+" with 
String.concat() is simple and direct.

-------------

Commit messages:
 - More discriptive comment
 - When handling an OutOfMemoryError due to off-heap allocation failure

Changes: https://git.openjdk.org/jdk/pull/17522/files
 Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=17522&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8324657
  Stats: 14 lines in 1 file changed: 7 ins; 2 del; 5 mod
  Patch: https://git.openjdk.org/jdk/pull/17522.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/17522/head:pull/17522

PR: https://git.openjdk.org/jdk/pull/17522

Reply via email to