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

Phil Race prr at openjdk.org
Thu Mar 13 21:36:52 UTC 2025


On Wed, 5 Mar 2025 21:34:09 GMT, Alexander Zuev <kizune at openjdk.org> wrote:

>> - Check that the calculated audio data size does not exceed available heap memory before committing to the rendering
>> - Add a test case
>
> Alexander Zuev has updated the pull request incrementally with two additional commits since the last revision:
> 
>  - Merge branch 'JDK-8350813' of https://github.com/azuev-java/jdk into JDK-8350813
>  - Add a treshold of 90% to avoid OOME because of the additional buffers needed to process sound bank.

What is being done here in terms of calculations is imprecise, but the specific test here
(comparring known to be required memory vs theoretically available memory) should prevent cases of almost certain OOME, without claiming that there will be no OOME if the test passes.
That's it. Not perfect, because free memory can change in either direction.

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

Marked as reviewed by prr (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/23814#pullrequestreview-2683418235


More information about the client-libs-dev mailing list