On Wed, 18 Mar 2026 15:27:51 GMT, Harald Eilertsen <[email protected]> wrote:

>> Just as a note, we probably might want to revise os::commit_memory and 
>> os::uncommit_memory then, since they use MAP_NORESERVE. Are they just noops 
>> now, and memory is committed on touch like on AIX?
>> 
>> This does not affect the current PR in any way. Just idle chatter that 
>> probably should happen somewhere else.
>
> We'll get to those a bit later, but if you want to have a look they're here:
> 
> `os::pd_commit_memory`:
> https://github.com/battleblow/jdk/blob/bsd-port/src/hotspot/os/bsd/os_bsd.cpp#L1881
> 
> `os::pd::uncommit_memory`:
> https://github.com/battleblow/jdk/blob/bsd-port/src/hotspot/os/bsd/os_bsd.cpp#L1980
> 
> The only difference is that uncommit uses `madvice()` to mark the pages as 
> freeable, but only if the `exec` flag is set. That looks wrong to me.

Ah okay. Thanks!

Yes, looks like you want to discard the memory regardless of exec flag.

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

PR Review Comment: 
https://git.openjdk.org/bsd-port/pull/4#discussion_r2954547485

Reply via email to