我遇到了这个错误:
"java.lang.OutOfMemoryError: Compressed class space"
在我弄清楚触发因素之前,我尝试 使用
禁用压缩类指针-XX:-UseCompressedClassPointers。
但我仍然得到这个错误。怎么可能?
谢谢!
最佳答案
此异常在 Understand the OutOfMemoryError Exception 中进行了解释:
Cause: On 64-bit platforms a pointer to class metadata can be represented by a 32-bit offset (with
UseCompressedOops
). This is controlled by the command line flagUseCompressedClassPointers
(on by default). If theUseCompressedClassPointers
is used, the amount of space available for class metadata is fixed at the amountCompressedClassSpaceSize
. If the space needed forUseCompressedClassPointers
exceedsCompressedClassSpaceSize
, ajava.lang.OutOfMemoryError
with detail Compressed class space is thrown.Action: Increase
CompressedClassSpaceSize
or you can turn offUseCompressedClassPointers
. Note: There are bounds on the acceptable size ofCompressedClassSpaceSize
. For example-XX:CompressedClassSpaceSize=4g
, exceeds acceptable bounds will result in a message such as CompressedClassSpaceSize of 4294967296 is invalid; must be between 1048576 and 3221225472.
关于java - 内存不足错误 : Compressed class space,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35162542/