简体   繁体   中英

How does JVM calculate the committed heap memory?

Based on the documentation : https://docs.oracle.com/javase/7/docs/api/java/lang/management/MemoryUsage.html

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). The Java virtual machine may release memory to the system and committed could be less than init. committed will always be greater than or equal to used.

but the question is how JVM calculate the committed memory?

Here you can find a little bit more detail, but it does not explain the exact way how committed heap space is increased:

There is also a committed heap size which acts as a "high water mark", moving up once the JVM cannot free up space even on old collection / young collection to make room. In this case, the committed heap size is increased . This cycle repeats until the committed heap size matches the maximum heap size, the maximum space allocatable.

https://support.mulesoft.com/s/article/Java-JVM-memory-allocation-pattern-explained

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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