问题描述
我安装了JDK 8并尝试运行Eclipse。我收到以下警告消息:
I have installed JDK 8 and trying to run Eclipse. I am getting following warning message:
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=512m;
support was removed in 8.0
忽略此论点的原因是什么?
What are the reasons of ignoring this argument?
推荐答案
忽略这些论点的原因是,由于以下缺点,HotSpot for JDK8中已删除了永久生成
Reasons of ignoring these argument is permanent generation has been removed in HotSpot for JDK8 because of following drawbacks
- 启动时的固定大小 - 难以调整。
- 内部热点类型是Java对象:可以使用完整GC移动,不透明,不强类型化且难以调试,需要元元数据。
- 简化完整集合:每个收集器的元数据特殊迭代器
- 想要同时释放类数据而不是在GC停顿期间
- 启用受PermGen限制的未来改进。
- Fixed size at startup – difficult to tune.
- Internal Hotspot types were Java objects : Could move with full GC, opaque, not strongly typed and hard to debug, needed meta-metadata.
- Simplify full collections : Special iterators for metadata for each collector
- Want to deallocate class data concurrently and not during GC pause
- Enable future improvements that were limited by PermGen.
永久性生成(PermGen)空间已被完全删除,并被一个名为Metaspace的新空间所取代。
删除PermGen的后果是显然 PermSize和MaxPermSize JVM参数被忽略 ,你永远不会得到java.lang.OutOfMemoryError:PermGen错误。
The Permanent Generation (PermGen) space has completely been removed and is kind of replaced by a new space called Metaspace.The consequences of the PermGen removal is that obviously the PermSize and MaxPermSize JVM arguments are ignored and you will never get a java.lang.OutOfMemoryError: PermGen error.
MetaSpace的优势
- 利用Java语言规范属性:类和关联的元数据生命周期匹配类加载器
- 每个加载器存储区域 - Metaspace
- 仅线性分配
- 没有单独的回收(除了RedefineClasses和类加载失败)
- 没有GC扫描或压缩
- 没有重新定位元数据空间对象
- Take advantage of Java Language Specification property : Classes and associated metadata lifetimes match class loader’s
- Per loader storage area – Metaspace
- Linear allocation only
- No individual reclamation (except for RedefineClasses and class loading failure)
- No GC scan or compaction
- No relocation for metaspace objects
元数据空间调整
最大元空间大小可以使用-XX:MaxMetaspaceSize标志设置,默认值为unlimited,这意味着只有系统内存是限制。 -XX:MetaspaceSize调整标志定义元空间的初始大小如果未指定此标志,则Metaspace将根据运行时的应用程序需求动态调整大小。
The maximum metaspace size can be set using the -XX:MaxMetaspaceSize flag, and the default is unlimited, which means that only your system memory is the limit. The -XX:MetaspaceSize tuning flag defines the initial size of metaspace If you don’t specify this flag, the Metaspace will dynamically re-size depending of the application demand at runtime.
更改将在未来启用其他优化和功能
Change enables other optimizations and features in the future
- 应用程序类数据共享
- 年轻集合优化,G1类卸载
- 元数据大小减少和内部JVM足迹项目
有改进GC性能也。
There is improved GC performace also. More detail
这篇关于在JDK 8中消除PermGen的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!