JVM内存类型 [英] JVM Memory Types

查看:80
本文介绍了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:

  • 非堆
  • 用法
  • 峰值
  • Coll

我们为所有这些列(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)

我们知道什么是堆和非堆,但是我们不知道使用率,峰值和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

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对象包含四个值:

A MemoryUsage object contains four values:

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 represents the amount of memory currently used (in bytes).

已提交表示可以保证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).

max 表示可用于内存管理的最大内存量(以字节为单位).它的值可能是不确定的.如果定义了最大内存量,则可能会随时间变化.

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.

如果内存分配尝试增加已用内存,即使已用< = max仍然为true(例如,当系统虚拟内存不足时),它也会尝试增加已用内存>分配,但可能会失败. /em>

A memory allocation may fail if it attempts to increase the used memory such that used > committed even if used <= max would still be true (for example, when the system is low on virtual memory).

看看这个链接以了解与内存相关的各种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内存池?

我没有找到有关CollUsed的任何信息,我怀疑问题中的类型错误.如果我没记错的话,我怀疑这可能是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天全站免登陆