RFR: 8292697: ZGC: Hangs when almost out of metaspace memory [v2]
Stefan Karlsson
stefank at openjdk.org
Mon Aug 29 06:29:22 UTC 2022
On Fri, 26 Aug 2022 16:50:08 GMT, Thomas Stuefe <stuefe at openjdk.org> wrote:
>> Stefan Karlsson has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Update test text
>
> src/hotspot/share/memory/metaspace.cpp line 998:
>
>> 996: }
>> 997:
>> 998: void Metaspace::purge(bool classes_unloaded) {
>
> Would it not have been more logical to heave both `MetaspaceCritical_lock` and `MetaspaceCriticalAllocation::process();` out of this function? As it is, `Metaspace::purge`, called with false, is now a no-op that only does things on behalf of the GC. It has nothing to do with the functioning of the allocator.
I understand what you mean. On the other hand, if you take a look at Metaspace::allocate, it does quite a lot more than being an allocator, for example, it calls into the GC code (which performs the other side of the metaspace critical allocations).
I wouldn't be opposed if anyone wanted to restructure this.
-------------
PR: https://git.openjdk.org/jdk/pull/9985
More information about the hotspot-dev
mailing list