Java监控堆内存使用大小
MemoryMXBean bean = ManagementFactory.getMemoryMXBean() ;System.out.println(bean.getHeapMemoryUsage().getMax()) ;System.out.println(bean.getHeapMemoryUsage().getUsed()) ;