简体   繁体   English

JVM内存类型

[英]JVM Memory Types

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. 一切工作正常,但是我们需要一些有关JVM内存使用情况详细信息。 We have some columns with different memory types. 我们有一些具有不同内存类型的列。 We need to know what these are: 我们需要知道这些是什么:

  • Heap
  • Non Heap 非堆
  • Usage 用法
  • Peak
  • Coll 科尔

We've got maximums for all these columns (HeapMax, NonHeapMax, UsageMax, PeakMax and CollMax) and also used (HeapUsed, NonHeapUsed, UsageUsed, PeakUsed and CollUsed) 我们为所有这些列(HeapMax,NonHeapMax,UsageMax,PeakMax和CollMax)获得了最大值,并且还使用了(HeapUsed,NonHeapUsed,UsageUsed,PeakUsed和CollUsed)

We know what Heap and NonHeap is, but we don't know about Usage, Peak and Coll. 我们知道堆和非堆是什么,但是我们不知道使用率,峰值和Coll。

Does anybody know what they are? 有人知道他们是什么吗?

Thank you in advance. 先感谢您。

Usage :- might be the memory currently being used (ie Used: in the image) 用法: -可能是目前所使用的内存(即应用于:图像中)

Peak :- might be the committed memory till the time (ie Commited: in the image) 峰值:-可能是直到该时间为止的已提交内存(即,已提交在图像中)

Coll :- might be the maximum memory that can be used (ie Max: in the image) Coll:-可能是可以使用的最大内存(即,图像中的Max :)

Max: is fixed for the running JMV's lifetime. 最大值:在运行的JMV的生存期内固定不变。

Used and Committed : varies as per the load. 已使用和已承诺 :根据负载而有所不同。

I have attached a snapshot of JConsole which lists these attributes. 我已经附上了JConsole的快照,其中列出了这些属性。

From java documentation link : 从Java 文档链接:

A MemoryUsage object represents a snapshot of memory usage. MemoryUsage对象表示内存使用情况的快照。 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类的实例由用于获取有关Java虚拟机的单个内存池或Java虚拟机的整个堆或非堆内存的内存使用信息的方法构造。

A MemoryUsage object contains four values: MemoryUsage对象包含四个值:

init represents the initial amount of memory (in bytes) that the Java virtual machine requests from the operating system for memory management during startup. init表示Java虚拟机在启动过程中从操作系统请求用于内存管理的初始内存量(以字节为单位)。

used represents the amount of memory currently used (in bytes). used表示当前使用的内存量(以字节为单位)。

committed represents the amount of memory (in bytes) that is guaranteed to be available for use by the Java virtual machine. 已提交表示可以保证可供Java虚拟机使用的内存量(以字节为单位)。 The amount of committed memory may change over time (increase or decrease). 提交的内存量可能会随时间变化(增加或减少)。

max represents the maximum amount of memory (in bytes) that can be used for memory management. max表示可用于内存管理的最大内存量(以字节为单位)。 Its value may be undefined. 它的值可能是不确定的。 The maximum amount of memory may change over time if defined. 如果定义了最大内存量,则可能会随时间变化。

The amount of used and committed memory will always be less than or equal to max if max is defined. 如果定义了max,则已使用和已提交的内存量将始终小于或等于max。

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

Have a look at this link to understand about various API related to memory. 查看此链接以了解与内存相关的各种API。

Have a look at this SE question for Heap and Non Heap memory types and internals of them. 看看这个关于堆和非堆内存类型及其内部的SE问题。

How is the java memory pool divided? java内存池如何划分?

I have not found any information about CollUsed and I am suspecting a type error in the question. 我没有找到有关CollUsed任何信息,我怀疑问题中的类型错误。 I suspect that it may be committed memory if I am not wrong. 我怀疑如果我没有记错的话,可能是committed内存。

Please cross check once on exact API. 请仔细检查一次确切的API。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM