how to get the min and max heap size settings of a JVM from within a Java program

后端 未结 4 491
心在旅途
心在旅途 2020-12-16 19:02

How to get the min and max heap size settings of a VM from within a Java program?

4条回答
  •  执笔经年
    2020-12-16 19:52

    You just need to use the Runtime object with Runtime.getRuntime() and then use methods like totalMemory() and freeMemory().

提交回复
热议问题