RFR: JDK-8304723: Statically allocate global mutexes [v5]
Thomas Stuefe
stuefe at openjdk.org
Fri Mar 24 07:38:32 UTC 2023
On Thu, 23 Mar 2023 15:27:58 GMT, Justin King <jcking at openjdk.org> wrote:
>> Switch to statically allocate storage for all of Hotspot's global mutexes and monitors. This avoids needing to allocate each one dynamically at startup. These also live for the lifetime of the program, so this reduces any potential memory fragmention in the C heap.
>
> Justin King has updated the pull request incrementally with one additional commit since the last revision:
>
> Move alignas before static
>
> Signed-off-by: Justin King <jcking at google.com>
@kimbarrett
>
> I see no mallocs for the names. The names come from macro stringizing the associated variable in defl(), so are string literals.
>
> The names used to be embedded in Mutex (providing some padding around the atomic parts I think), with the string passed to the constructor strcpy?ed into that embedded buffer, but that was removed by JDK-8264146.
>
Names are strduped since https://bugs.openjdk.org/browse/JDK-8265682.
https://github.com/openjdk/jdk/blob/7491f771fac0dca094bac0e5e53afdcf6a4da798/src/hotspot/share/runtime/mutex.cpp#L277
-------------
PR Comment: https://git.openjdk.org/jdk/pull/13143#issuecomment-1482376182
More information about the hotspot-dev
mailing list