JVM Memory Types

吃可爱长大的小学妹 提交于 2019-12-13 15:54:19

问题


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:

  • 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)

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

Does anybody know what they are?

Thank you in advance.


回答1:


From java documentation link :

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.

A MemoryUsage object contains four values:

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).

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 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.

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

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).

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

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

How is the java memory pool divided?

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.

Please cross check once on exact API.




回答2:


Usage :- might be the memory currently being used (i.e. Used: in the image)

Peak :- might be the committed memory till the time (i.e. Commited: in the image)

Coll :- might be the maximum memory that can be used (i.e. Max: in the image)

Max: is fixed for the running JMV's lifetime.

Used and Committed : varies as per the load.

I have attached a snapshot of JConsole which lists these attributes.



来源:https://stackoverflow.com/questions/35290787/jvm-memory-types

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!