-XX:MaxPermSize做什么? [英] What does -XX:MaxPermSize do?

查看:116
本文介绍了-XX:MaxPermSize做什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

具体来说,为什么修复PermGen OutOfMemoryError问题会有所帮助?

Specifically, why would it help to fix a PermGen OutOfMemoryError issue?

此外,答案的奖励积分指向了JVM参数的文档......

Also, bonus points for an answer that points me to the documentation on JVM arguments...

推荐答案

永久空间是存储VM使用的类,方法,内化字符串和类似对象的地方,永远不会释放(因此得名)。

The permanent space is where the classes, methods, internalized strings, and similar objects used by the VM are stored and never deallocated (hence the name).

这篇Oracle文章简洁地介绍了HotSpot GC的工作和参数化,并建议你在加载许多类时增加这个空间(这通常适用于应用程序服务器和类似IDE的情况) Eclipse):

This Oracle article succinctly presents the working and parameterization of the HotSpot GC and advises you to augment this space if you load many classes (this is typically the case for application servers and some IDE like Eclipse) :


对于大多数应用程序,永久代对垃圾
收集器性能没有明显影响。但是,一些
应用程序动态生成并加载许多类;例如,
JavaServer Pages(JSP)页面的一些实现。这些
应用程序可能需要更大的永久代,才能持有
额外的类。如果是这样,最大永久生成大小可以通过命令行选项-XX增加
:MaxPermSize =。

The permanent generation does not have a noticeable impact on garbage collector performance for most applications. However, some applications dynamically generate and load many classes; for example, some implementations of JavaServer Pages (JSP) pages. These applications may need a larger permanent generation to hold the additional classes. If so, the maximum permanent generation size can be increased with the command-line option -XX:MaxPermSize=.

请注意,此其他Oracle文档列出了另一个HotSpot参数。

Note that this other Oracle documentation lists the other HotSpot arguments.

更新:从Java 8开始,permgen空间和此设置都消失了。用于加载的类和方法的内存模型是不同的,并且不受限制(使用默认设置)。你不应该再看到这个错误了。

Update : Starting with Java 8, both the permgen space and this setting are gone. The memory model used for loaded classes and methods is different and isn't limited (with default settings). You should not see this error any more.

这篇关于-XX:MaxPermSize做什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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