RFR: JDK-8301749: Tracking malloc pooled memory size [v3]
Johan Sjölen
jsjolen at openjdk.org
Thu Feb 9 11:05:41 UTC 2023
On Wed, 8 Feb 2023 13:25:15 GMT, Thomas Stuefe <stuefe at openjdk.org> wrote:
> > > return -1.
> > > You aim to mimic the malloc_info() API at os:: level, so you should return -1 in case malloc_info failed, including failure do to resolving issues.
> >
> >
> > Wouldn't that lead to a caller not knowing whether `malloc_info` itself failed or if our wrapper failed?
>
> Why would that matter?
>
This matters when a caller sees -1, reads errno, and then takes an action depending on errno. If it was our wrapper that failed, then this will be a "stale" errno and a faulty action will be taken. This matters in `MallocInfoDcmd::execute` because we send different error messages depending on whether the wrapper failed or `malloc_info(3)` failed.
-------------
PR: https://git.openjdk.org/jdk/pull/12455
More information about the hotspot-runtime-dev
mailing list