RFR: 8302154: Hidden classes created by LambdaMetaFactory can't be unloaded [v2]

Volker Simonis simonis at openjdk.org
Wed Feb 22 11:23:15 UTC 2023


On Tue, 21 Feb 2023 19:49:24 GMT, Coleen Phillimore <coleenp at 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


More information about the core-libs-dev mailing list