Is MetaSpace going to GC by default?
Yes, the GC will work in the metaspace, when it is full, it will also dynamically increase (given that it is allowed) the memory allocated for the metadata.
Even PermGen is going to GC by adding arguments like -XX: + CMSClassUnloadingEnabled, then what makes MetaSpace better than PermGen?
The improvement is due to the dynamic expansion of metaspace, which permgen could not do.
Is MetaSpace based on its own memory, so does it store Java objects on disks, not a virtual machine?
Based on the description of metaspace, it uses only its own memory (without swapping).
Based on a study by Pierre-Hugue Charbonneau ( link here ), it became clear that the introduction of the metaspace does not necessarily solve the OOM problem, at best it solves the problem, it tries to dynamically change the memory size of the metascope to accommodate the growing number of classes that are loaded with possible side effects the effect of uncontrolled growth (as long as it allows its own memory).
We can achieve the well-known OOM error by setting the MaxMetaspaceSize argument to the JVM and running the provided sample program.
Many thanks to Pierre Hugh Charbonneau.
Anantha Sharma Jun 06 '14 at 6:12 2014-06-06 06:12
source share