java - 内存不足错误 : Compressed class space

标签 java memory-leaks java-8 out-of-memory metaspace

我遇到了这个错误:

 "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 flag UseCompressedClassPointers (on by default). If the UseCompressedClassPointers is used, the amount of space available for class metadata is fixed at the amount CompressedClassSpaceSize. If the space needed for UseCompressedClassPointers exceeds CompressedClassSpaceSize, a java.lang.OutOfMemoryError with detail Compressed class space is thrown.

Action: Increase CompressedClassSpaceSize or you can turn off UseCompressedClassPointers. Note: There are bounds on the acceptable size of CompressedClassSpaceSize. 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/

相关文章:

java - 服务器断开连接后如何在 Spring MVC 中保持客户端 session 处于 Activity 状态

java - Maven 生成空 JAR

java静态成员内存泄漏

objective-c - Objective c - 滚动表格 View 时发生奇怪的泄漏

scala - 如何修复 Scala 应用程序中的 "static methods in interface require -target:jvm-1.8"?

java - 启动新的 Activity 会导致应用程序重新启动

java - 尝试在类构造函数中将两个 BigInteger 数字相加并出现堆栈溢出错误

c++ - vector 内存泄漏

java - SimpleDateFormat 与带有时区的 ZonedDateTime

java - 使用 Kerberos S4U 扩展(在 Java 8 中引入)通过 JDBC 连接到数据库