JDK 8 中的 PermGen 消除 [英] PermGen elimination in JDK 8

查看:23
本文介绍了JDK 8 中的 PermGen 消除的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经安装了 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 for ignoring this VM option?

推荐答案

忽略这些参数的原因是由于以下缺点,在 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 限制的未来改进.

永久代 (PermGen) 空间已完全删除,并被称为元空间的新空间所取代.删除 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 语言规范属性:类和关联的元数据生命周期与类加载器相匹配
  • 每个加载器存储区域 - 元空间
  • 仅线性分配
  • 没有单独的回收(RedefineClasses 和类加载失败除外)
  • 无 GC 扫描或压缩
  • 元空间对象没有重定位

元空间调整

可以使用 -XX:MaxMetaspaceSize 标志设置最大元空间大小,默认为无限制,这意味着只有您的系统内存是限制.-XX:MetaspaceSize 调整标志定义了元空间的初始大小.如果不指定此标志,元空间将在运行时根据应用程序需求动态重新调整大小.

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

  • 应用类数据共享
  • Young 集合优化,G1 类卸载
  • 减少元数据大小和内部 JVM 占用空间项目

GC 性能也有所提高.更多详情

There is improved GC performace also. More Details

这篇关于JDK 8 中的 PermGen 消除的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆