RFR: 8365165: Zap C-heap memory at delete/free
Thomas Stuefe
stuefe at openjdk.org
Fri Aug 15 15:19:12 UTC 2025
On Fri, 15 Aug 2025 15:03:45 GMT, Aleksey Shipilev <shade at openjdk.org> wrote:
>> Okay, I see. So it's the other way around, we zap newly allocated memory, but not free memory. I thought you were doing that, according to your comment:
>>
>>> When NMT is enabled (which it is for debug builds), we can also do this for frees, as NMT tells us the size of the free-ed block.
>
> The PR does *all three*, take a look? Current code already zaps on malloc/realloc path, those paths are now under new `ZapCHeap` flag. New code zaps on free path, and it is also under new `ZapCHeap` flag. So in the end, `ZapCHeap` covers malloc/realloc/free, and thus it has a proper name.
Ah okay. I should not review on Friday evenings. All good, then.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/26775#discussion_r2279194075
More information about the hotspot-runtime-dev
mailing list