On Mon, 21 Sep 2026 12:49:07 GMT, Per Minborg <[email protected]> wrote:

>> This PR proposes removing the entire internal `BufferStack` and associated 
>> classes and tests. Instead, we can now simply rely on a `Arena.ofConfined` 
>> which will provide pooling for us automatically.
>> 
>> If integrated, this PR would imply:
>> 1,511 lines removed net across 13 files compared with master:
>> - 602 production-source lines
>> - 909 test and benchmark lines
>> 
>> ---------
>> - [x] I confirm that I make this contribution in accordance with the 
>> [OpenJDK Interim AI Policy](https://openjdk.org/legal/ai).
>
> Per Minborg has updated the pull request incrementally with one additional 
> commit since the last revision:
> 
>   Address comments in PR

src/java.base/share/classes/jdk/internal/foreign/abi/SharedUtils.java line 414:

> 412:             } catch (OutOfMemoryError oome) {
> 413:                 throw handleOome(oome, arena);
> 414:             }

This OOME handling looks like overkill to me. In the best case this would let 
us clean up the native memory attached to the arena by `allocate` when creating 
the slicing allocator or bounded arena instance, but there are already cases 
where we can leak native memory on OOME in `SegmentFactories` itself, for 
instance when the allocation of the cleanup action fails.

I suggest just leaving this out. Arbitrary OOMEs are not really meant to be 
recoverable any way. Any leak will get cleaned up when the process terminates.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/32924#discussion_r4094144922

Reply via email to