Suppose I have a JVM that is solely dedicate to run one program, how can I get the amount of RAM that is allocated to the JVM?
Let's say my computer has 4GB and I specify via JVM parameters that the max it should used is 2GB, then 2GB is the output that I should get.
Conversely, if I do not specify any parameters to the JVM, the output should be the default value, whatever it is.