Eliminating PermGen in JDK 8
Upon upgrading to JDK 8, you may encounter a warning message while attempting to launch Eclipse. This warning indicates that the "MaxPermSize" Java Virtual Machine (JVM) option is being ignored due to its removal in JDK 8.
Reasons for Ignoring "MaxPermSize"
The Permanent Generation (PermGen) space, managed by the "MaxPermSize" option, has been removed from HotSpot in JDK 8. This was primarily due to several drawbacks:
MetaSpace: A Replacement for PermGen
PermGen has been replaced by Metaspace, a new space that addresses these drawbacks. Metaspace offers several advantages:
Metaspace Tuning
While Metaspace's maximum size is typically unlimited, you can set it using the "-XX:MaxMetaspaceSize" flag. Additionally, "-XX:MetaspaceSize" defines its initial size. If unspecified, Metaspace will dynamically adjust based on runtime demand.
In conclusion, the elimination of PermGen and the introduction of Metaspace in JDK 8 have resulted in improved GC performance and simplified runtime management. Developers should be aware of the deprecation of the "MaxPermSize" option and its implications for their applications.
The above is the detailed content of What Replaced PermGen in JDK 8 and How Does It Work?. For more information, please follow other related articles on the PHP Chinese website!