This content has been marked as final. Show 3 replies
Maybe i'm not understanding your question, but if you are looking for how much memory the java process is using, you have the answer already (those lines of code in your original question). Those values are not the system memory size and usage, they are the jvm process memory allowance and usage.
if you want the system values, you can use this JMX mbean: