JVM 内存类型 [英] JVM Memory Types

查看:31
本文介绍了JVM 内存类型的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在做一个监控项目;我们让监控软件工作并从服务器重新收集指标.一切正常,但我们需要一些有关 JVM 内存使用详细信息的信息.我们有一些具有不同内存类型的列.我们需要知道这些是什么:

I'm working on a monitoring project; we have the monitoring software working and recollecting the metrics from the server. Everything is working fine, but we need some information about the JVM Memory Usage details. We have some columns with different memory types. We need to know what these are:

  • 非堆
  • 用法
  • 峰值
  • 科尔

我们有所有这些列(HeapMax、NonHeapMax、UsageMax、PeakMax 和 CollMax)的最大值,并且还使用了(HeapUsed、NonHeapUsed、UsageUsed、PeakUsed 和 CollUsed)

We've got maximums for all these columns (HeapMax, NonHeapMax, UsageMax, PeakMax and CollMax) and also used (HeapUsed, NonHeapUsed, UsageUsed, PeakUsed and CollUsed)

我们知道 Heap 和 NonHeap 是什么,但我们不知道 Usage、Peak 和 Coll.

We know what Heap and NonHeap is, but we don't know about Usage, Peak and Coll.

有人知道它们是什么吗?

Does anybody know what they are?

提前致谢.

推荐答案

来自 java 文档 链接:

From java documentation link :

MemoryUsage 对象表示内存使用情况的快照.MemoryUsage 类的实例通常由用于获取 Java 虚拟机的单个内存池或整个 Java 虚拟机的堆或非堆内存的内存使用信息的方法构造.

A MemoryUsage object represents a snapshot of memory usage. Instances of the MemoryUsage class are usually constructed by methods that are used to obtain memory usage information about individual memory pool of the Java virtual machine or the heap or non-heap memory of the Java virtual machine as a whole.

一个 MemoryUsage 对象包含四个值:

init 表示 Java 虚拟机在启动期间从操作系统请求用于内存管理的初始内存量(以字节为单位).

init represents the initial amount of memory (in bytes) that the Java virtual machine requests from the operating system for memory management during startup.

used 表示当前使用的内存量(以字节为单位).

used represents the amount of memory currently used (in bytes).

committed 表示保证可供 Java 虚拟机使用的内存量(以字节为单位).提交的内存量可能会随时间变化(增加或减少).

committed represents the amount of memory (in bytes) that is guaranteed to be available for use by the Java virtual machine. The amount of committed memory may change over time (increase or decrease).

ma​​x 表示可用于内存管理的最大内存量(以字节为单位).它的值可能未定义.如果已定义,最大内存量可能会随时间变化.

max represents the maximum amount of memory (in bytes) that can be used for memory management. Its value may be undefined. The maximum amount of memory may change over time if defined.

如果定义了 max,则使用和提交的内存量将始终小于或等于 max.

The amount of used and committed memory will always be less than or equal to max if max is defined.

如果内存分配尝试增加已用内存,从而使 used > 提交,即使 used <= max 仍然为真,则内存分配可能会失败(例如,当系统虚拟内存不足时).

看看这个链接以了解与内存相关的各种API.

Have a look at this link to understand about various API related to memory.

查看有关堆和非堆内存类型及其内部结构的 SE 问题.

Have a look at this SE question for Heap and Non Heap memory types and internals of them.

java内存池是如何划分的?

我没有找到任何关于 ColUsed 的信息,我怀疑问题中存在类型错误.如果我没记错,我怀疑它可能是committed内存.

I have not found any information about CollUsed and I am suspecting a type error in the question. I suspect that it may be committed memory if I am not wrong.

请对确切的 API 进行一次交叉检查.

Please cross check once on exact API.

这篇关于JVM 内存类型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆