If you turn on the coherence monitoring by setting the jvm property, -Dtangosol.coherence.management.remote=true, you can check the Coherence status via the JMX client like Jconsole. I.e you can click the Node of Coherence domain, and see all the Nodes information, like MaxMemory, FreeMemory.
always we set up the heap size constant. min and max to the same value, I set it up to 300M here.
But when I check the node attributes of max and free memory, the max one is not 300M, and sometimes, even keep changing.
then I check the code, to return the MemoryMaxMB, pretty simple, just call runtime to get the maxmemory.
I created the following bTrace script, and make sure it is calling this code. And I am right.
@OnMethod(clazz = "com.tangosol.coherence.component.net.management.model.localModel.ClusterNodeModel", method = "getMemoryMaxMB", location = @Location(value = Kind.RETURN))
then the question is why the maxmemory here is 287 or some value instead of 300M ?
I did a another test, change the JVM to Jrockit, what do you expect? it shows 300M.
conclusion, the MemoryMaxMB reported here vary by JVM. because each JVM vendor has it’s own implementation of the JVM.