On Tue, 21 Feb 2023 19:49:24 GMT, Coleen Phillimore <cole...@openjdk.org> wrote:
> The reason that non-strongly linked classes have their own ClassLoaderData is > because it implements the property that when the class loader is no longer > loaded, metadata for it can be removed at once. Even though Metaspace has > been redesigned to be less fragmented, this is simpler than removing selected > entities inside metaspace. Replacing it with a more sophisticated design > would not an be an improvement. So I have to disagree with your statement > above. How could it be not an improvement to save ~600 bytes of native memory per class? Sorry, but I start to have real problems to follow this discussion. First you don't want to change strongly linked Hidden Classes to weakly linked ones **because** of the native memory overhead and then you say that a more sophisticated implementation which will eliminate this overhead would **not** be an improvement. I'm puzzled. ------------- PR: https://git.openjdk.org/jdk/pull/12493