RFR: JDK-8295865: Several issues with os::realloc

Thomas Stuefe stuefe at openjdk.org
Wed Nov 2 14:03:26 UTC 2022


On Wed, 2 Nov 2022 12:40:18 GMT, David Holmes <dholmes at openjdk.org> wrote:

>> Not guaranteed, but it can happen.
>> 
>> `memflags` can theoretically be different, the memory would then just be re-booked to the new category. In practice, nobody does this.
>> 
>> `stack` can differ. Memory is accounted per { stack, flags } tupel in a hash table. Only matters for nmt "details" level though.
>
> Don't you need to restore things exactly the way they were?

Shoot, you are right. memflags would be easy, but stack not so much. 

This may be difficult to fix. Note that the only negative effect this has is that in the very low probability case that realloc fails  *and* we run with NMT=detail, the original allocation is re-booked under the wrong stack.

I'll check how difficult this is to fix.

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

PR: https://git.openjdk.org/jdk/pull/10857


More information about the hotspot-runtime-dev mailing list