title: Mismatch between Spring Actuator's "jvm.memory.max" metric and Runtime.getRuntime().maxMemory()
body: <p>I'm trying out Spring Boot Actuator and looking at the "/actuator/metrics/jvm.memory.max" endpoint. </p>
  
  <p>I am also running my Springboot app with the following JVM option: </p>
  
  <p>-Xmx104m</p>
  
  <p>I created an endpoint ("/memory" which returns the Total, Free, Used &amp; Max memory for the app. I used Runtime.getRuntime().getXXX() methods for this. </p>
  
  <p>The question that I have is that the value Springboot's "jvm.memory.max" shows me in bytes does not match with the -Xmx value and what the "/memory" endpoint shows me. </p>
  
  <p>Any thoughts why this mismatch?</p>
  
  <p><a href="https://i.stack.imgur.com/u78aA.png" rel="noreferrer"><img src="https://i.stack.imgur.com/u78aA.png" alt="enter image description here"></a></p>
  
  <p><a href="https://i.stack.imgur.com/wRKKa.png" rel="noreferrer"><img src="https://i.stack.imgur.com/wRKKa.png" alt="enter image description here"></a></p>