为什么会发生Permgen OutOfMemeoryError? [英] Why does Permgen OutOfMemeoryError occurs?
问题描述
直到今天,我知道permgen
空间有一定的限制,并且当此限制用尽时,OutOfMemoryError
就会出现,我认为这是正确的,因为我已经看到了OutOfMemoryError
彼尔姆根空间.
Till today, I knew permgen
space has some limit and when this limit is exhausted, OutOfMemoryError
comes, and I think this is correct because I have seen OutOfMemoryError
Permgen space.
但是在Java虚拟机内部引号
方法区域的大小无需固定.随着Java应用程序的运行,虚拟机可以扩展和收缩方法区域以适应应用程序的需求.
The size of the method area need not be fixed. As the Java application runs, the virtual machine can expand and contract the method area to fit the application's needs.
那么,当JVM可以扩展时,为什么会出现错误?扩展有限制吗?
So, when JVM can expand, why the error comes? Is there any limit for expansion?
推荐答案
Method Area
是较大的PermGen
或非堆"存储区的一部分. PermSize
设置固定了PermGen
可以使用的最大内存.由于Method Area
是PermGen
的子部分,因此只要PermGen
的总大小保持在指定的限制内,它就可以根据需要进行扩展.
The Method Area
is part of larger PermGen
or Non-Heap memory area. The PermSize
setting fixes the maximum memory the the PermGen
can use. Since Method Area
is a subpart of PermGen
, it can expand as needed as long as the overall PermGen
size remains withing specified limit.
PermGen
空间需求超过指定限制的那一刻(例如由于扩展了Method Area
),将抛出OutOfMemoryError
.
The moment, PermGen
space requirement goes beyond the specified limit, (say because of expanding Method Area
), OutOfMemoryError
is thrown.
这篇关于为什么会发生Permgen OutOfMemeoryError?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!