MemoryMXBean bean = ManagementFactory.getMemoryMXBean() ;
System.out.println(bean.getHeapMemoryUsage().getMax()) ;
System.out.println(bean.getHeapMemoryUsage().getUsed()) ;
Java监控堆内存使用大小
最新推荐文章于 2022-12-30 18:38:23 发布
MemoryMXBean bean = ManagementFactory.getMemoryMXBean() ;
System.out.println(bean.getHeapMemoryUsage().getMax()) ;
System.out.println(bean.getHeapMemoryUsage().getUsed()) ;