JEP proposed to target JDK 16: 387: Elastic Metaspace


Return unused HotSpot class-metadata (i.e., metaspace) memory to the operating system more promptly, reduce metaspace footprint, and simplify the metaspace code in order to reduce maintenance costs…

More at https://mail.openjdk.java.net/pipermail/jdk-dev/2020-September/004726.html