On Wed, 18 Mar 2026 14:27:56 GMT, Thomas Stuefe <[email protected]> wrote:

>> Looks like `MAP_NORESERVE` was removed from FreeBSD ages ago...
>> https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=193961 (commit 
>> https://svnweb.freebsd.org/ports?view=revision&revision=374392)
>
> 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.

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

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

Reply via email to