RFR: 8320370: NMT: Change MallocMemorySnapshot to simplify code. [v2]

Thomas Stuefe stuefe at openjdk.org
Tue Nov 21 15:06:08 UTC 2023


On Tue, 21 Nov 2023 14:15:14 GMT, Zhengyu Gu <zgu at openjdk.org> wrote:

> > I believe the reason for the original shape of this code was to avoid initialization altogether if NMT was disabled. @zhengyu123 ?
> 
> I believe it was coded this way to avoid memory allocation (malloc) during NMT initialization, before tracking infrastructure is ready, e.g. `MallocSiteTable` is initialized.
> 
> IIRC, not using static variable was to workaround the order of static variable initialization by linker, cannot remember the details.

That makes a lot of sense. Its a moot point now since https://bugs.openjdk.org/browse/JDK-8256844

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

PR Comment: https://git.openjdk.org/jdk/pull/16724#issuecomment-1821098391


More information about the hotspot-runtime-dev mailing list