RFR: JDK-8276731: Metaspace chunks are uncommitted twice

Thomas Stuefe stuefe at openjdk.java.net
Tue Nov 9 13:30:42 UTC 2021


On Tue, 9 Nov 2021 12:49:12 GMT, Coleen Phillimore <coleenp at openjdk.org> wrote:

> I think this is fine. But now get_chunk won't uncommit memory, so could there be a scenario where we need to uncommit chunks outside of class unloading? I sort of doubt it but haven't thought about it for a long time. What do you think?

Hi Coleen, thanks for thinking about this again :)

No, there is no reason to uncommit outside of class unloading. It's actually the other way around: As you noticed, the only other caller of `ChunkManager::return_chunk()` is `ChunkManager::get_chunk()` where `get_chunk()` takes a large chunk from the list, splits it, returns one sub chunk to the caller and the remainder splinters back into the list by calling `return_chunk()`. Today, the splinter chunks would be uncommitted again, which is pointless. They are uncommitted at that point.

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

PR: https://git.openjdk.java.net/jdk/pull/6277


More information about the hotspot-runtime-dev mailing list