获取jvm运行时内存状况

来源:互联网 发布:linux基本命令大全 编辑:程序博客网 时间:2024/05/20 12:22
    public static void main(String[] args) {
// TODO Auto-generated method stub

System.out.println("Max:"+Runtime.getRuntime().maxMemory());

System.out.println("Free:"+Runtime.getRuntime().freeMemory());

System.out.println("Total:"+Runtime.getRuntime().totalMemory());

}
0 0