RFR: 8350813: Rendering of bulky sound bank from MIDI sequence can cause OutOfMemoryError [v3]

Sergey Bylokhov serb at openjdk.org
Tue Mar 4 03:59:51 UTC 2025


On Mon, 3 Mar 2025 22:48:17 GMT, Alexander Zuev <kizune at openjdk.org> wrote:

> I am not trying to solve this problem for the reason stated above - i do not think it is a problem that needs to be solved.

But this issue should be addressed—it's similar to a zip bomb, where small but valid source data can consume a huge amount of memory after processing. To handle this, we should convert a fatal OutOfMemoryError into an IOException, which the application is likely already expecting.

It's unlikely that throwing an IOException will also cause an OOM, since before the new exception is thrown, the GC will clean up, freeing the allocated multi-gigabyte data in this block.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/23814#discussion_r1978568070


More information about the client-libs-dev mailing list