Re: RFR: 8324657: Intermittent OOME on exception message create [v2]
> 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. Roger Riggs has updated the pull request incrementally with one additional commit since the last revision: Wrap long line - Changes: - all: https://git.openjdk.org/jdk/pull/17522/files - new: https://git.openjdk.org/jdk/pull/17522/files/bfe60737..e83eb84b Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=17522&range=01 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=17522&range=00-01 Stats: 2 lines in 1 file changed: 1 ins; 0 del; 1 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
Re: RFR: 8324657: Intermittent OOME on exception message create
On Mon, 22 Jan 2024 20:52:32 GMT, Roger Riggs wrote: > 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. src/java.base/share/classes/java/io/ObjectInputStream.java line 2016: > 2014: // Generate an InvalidObjectException for an OutOfMemoryError > 2015: // Use String.concat() to avoid string formatting invoke dynamic > 2016: private static InvalidObjectException > genInvalidObjectException(OutOfMemoryError oome, String[] ifaces) { Isn't this new line is too long? It seems most of the file uses 80 chars per line. - PR Review Comment: https://git.openjdk.org/jdk/pull/17522#discussion_r1465700346
Re: RFR: 8324657: Intermittent OOME on exception message create
On Mon, 22 Jan 2024 20:52:32 GMT, Roger Riggs wrote: > 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. Marked as reviewed by naoto (Reviewer). - PR Review: https://git.openjdk.org/jdk/pull/17522#pullrequestreview-1842551871
Re: RFR: 8324657: Intermittent OOME on exception message create
On Mon, 22 Jan 2024 20:52:32 GMT, Roger Riggs wrote: > 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. Marked as reviewed by iris (Reviewer). - PR Review: https://git.openjdk.org/jdk/pull/17522#pullrequestreview-1842436256
Re: RFR: 8324657: Intermittent OOME on exception message create
On Mon, 22 Jan 2024 20:52:32 GMT, Roger Riggs wrote: > 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. Marked as reviewed by lancea (Reviewer). - PR Review: https://git.openjdk.org/jdk/pull/17522#pullrequestreview-1837408236
RFR: 8324657: Intermittent OOME on exception message create
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