CompressedClassSpaceSize 区域是否包含 MaxMetaspaceSize 区域?

2023-08-24Java开发问题
208

本文介绍了CompressedClassSpaceSize 区域是否包含 MaxMetaspaceSize 区域?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

问题描述

什么是CompressedClassSpaceSize?

CompressedClassSpaceSizeMetaspaceSize是什么关系?

推荐答案

Metaspace 是用于存储类元数据的内存区域 - 解析 .class 文件时创建的内部 JVM 结构.

Metaspace is the memory area for storing class metadata - internal JVM structures created while parsing .class files.

类元数据包括:

  • Java 类的内部表示
  • 方法及其字节码
  • 字段描述符
  • 恒定池
  • 符号
  • 注释
  • 等等

-XX:MaxMetaspaceSize默认无限制.

-XX:+UseCompressedClassPointers 选项为 ON(堆 <32G 的默认值)时,类从 Metaspace 移动到称为 Compressed Class Space 的单独区域.这是为了允许使用 32 位值而不是 64 位来寻址 VM 类结构.

When -XX:+UseCompressedClassPointers option is ON (default for heaps < 32G), classes are moved from Metaspace to the separate area called Compressed Class Space. This is to allow addressing VM class structures with 32-bit values instead of 64-bit.

因此,Compressed Class Space 包含 Java 类的内部表示,而 Metaspace 包含所有其他元数据:方法、常量池、注释等.

So, Compressed Class Space contains internal representation of Java classes, while Metaspace holds all the rest metadata: methods, constant pools, annotations, etc.

Compressed Class Space的大小受-XX:CompressedClassSpaceSize限制,默认为1G.-XX:CompressedClassSpaceSize的最大可能值为3G.

The size of Compressed Class Space is limited by -XX:CompressedClassSpaceSize, which is 1G by default. The maximum possible value of -XX:CompressedClassSpaceSize is 3G.

非类元空间和压缩类空间是两个不相交的区域.MaxMetaspaceSize 限制两个区域的提交大小:

Non-class Metaspace and Compressed Class Space are two disjoint areas. MaxMetaspaceSize limits the committed size of both areas:

committed(Non-class Metaspace) + committed(Compressed Class Space) <= MaxMetaspaceSize

如果MaxMetaspaceSize设置小于CompressedClassSpaceSize,后者自动减小到

If MaxMetaspaceSize is set smaller than CompressedClassSpaceSize, the latter is automatically decreased to

CompressedClassSpaceSize = MaxMetaspaceSize - 2*InitialBootClassLoaderMetaspaceSize

这篇关于CompressedClassSpaceSize 区域是否包含 MaxMetaspaceSize 区域?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

The End

相关推荐

如何使用 JAVA 向 COM PORT 发送数据?
How to send data to COM PORT using JAVA?(如何使用 JAVA 向 COM PORT 发送数据?)...
2024-08-25 Java开发问题
21

如何使报表页面方向更改为“rtl"?
How to make a report page direction to change to quot;rtlquot;?(如何使报表页面方向更改为“rtl?)...
2024-08-25 Java开发问题
19

在 Eclipse 项目中使用西里尔文 .properties 文件
Use cyrillic .properties file in eclipse project(在 Eclipse 项目中使用西里尔文 .properties 文件)...
2024-08-25 Java开发问题
18

有没有办法在 Java 中检测 RTL 语言?
Is there any way to detect an RTL language in Java?(有没有办法在 Java 中检测 RTL 语言?)...
2024-08-25 Java开发问题
11

如何在 Java 中从 DB 加载资源包消息?
How to load resource bundle messages from DB in Java?(如何在 Java 中从 DB 加载资源包消息?)...
2024-08-25 Java开发问题
13

如何更改 Java 中的默认语言环境设置以使其保持一致?
How do I change the default locale settings in Java to make them consistent?(如何更改 Java 中的默认语言环境设置以使其保持一致?)...
2024-08-25 Java开发问题
13