本文介绍了什么是Java中的'PermSize'?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 Java内存管理

I was going through the document in Java Memory Management and in that I came across PermSize which I couldn't understand. The document says that it stores, "JVM stores its metadata", but I couldn't exactly get what is meant by metadata. I was googling and somewhere I read it stores a value object (user defined object).

那里存储了什么样的对象?一个解释的例子很棒。

What kind of objects are stored there? An example with an explanation would be great.

推荐答案

永久代的快速定义:

换句话说,这就是类定义的地方(这解释了为什么你可能会得到消息 OutOfMemoryError:PermGen space 如果应用程序加载大量类和/或重新部署)。

In other words, this is where class definitions go (and this explains why you may get the message OutOfMemoryError: PermGen space if an application loads a large number of classes and/or on redeployment).

请注意 PermSize 是用户在JVM选项上设置的 -Xmx 值的补充。但是 MaxPermSize 允许JVM能够增长 PermSize 到指定的金额。最初加载虚拟机时, MaxPermSize 仍然是默认值( -client 和64mb用于 -server )但在需要之前实际上不会占用该金额。另一方面,如果你设置 PermSize MaxPermSize 到256mb,您会注意到 -Xmx 设置的整体堆增加了256mb。

Note that PermSize is additional to the -Xmx value set by the user on the JVM options. But MaxPermSize allows for the JVM to be able to grow the PermSize to the amount specified. Initially when the VM is loaded, the MaxPermSize will still be the default value (32mb for -client and 64mb for -server) but will not actually take up that amount until it is needed. On the other hand, if you were to set BOTH PermSize and MaxPermSize to 256mb, you would notice that the overall heap has increased by 256mb additional to the -Xmx setting.

这篇关于什么是Java中的'PermSize'?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!