Difference in Used, Committed and Max Heap Memory

From the Java Doc of MemoryUsage,

getUsed is:

the amount of used memory in bytes

getCommitted()

Returns the amount of memory in bytes that is committed for the Java
virtual machine to use. This amount of memory is guaranteed for the
Java virtual machine to use.

getMax()

Returns the maximum amount of memory in bytes that can be used for
memory management. This method returns -1 if the maximum memory size
is undefined.

This amount of memory is not guaranteed to be available for memory
management if it is greater than the amount of committed memory. The
Java virtual machine may fail to allocate memory even if the amount of
used memory does not exceed this maximum size.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)