RFR: 8370527: Memory leak after 8316694: Implement relocation of nmethod within CodeCache
    Chad Rakoczy 
    duke at openjdk.org
       
    Tue Oct 28 16:16:15 UTC 2025
    
    
  
On Tue, 28 Oct 2025 14:54:27 GMT, Evgeny Astigeevich <eastigeevich at openjdk.org> wrote:
> I don't understand this patch. So for release builds, we get stuck at `reference_count=1` and do continuous `os::free(_immutable_data)`? How's that correct?
The reference counter will still be 1 but the memory will be freed. We first check `if (_immutable_data != blob_end())` to verify that the nmethod has immutable data. If it doesn't we never read the reference counter
Also after either 1) the reference counter has been updated or 2) the memory has been freed we set `_immutable_data = blob_end();` so that if purge is called again (which I'm not sure if that ever actually happens) it won't even attempt to read the reference counter so it's not an issue of double freeing or reading freed memory
-------------
PR Comment: https://git.openjdk.org/jdk/pull/28008#issuecomment-3457316819
    
    
More information about the hotspot-compiler-dev
mailing list