📅  最后修改于: 2022-03-11 14:52:30.163000             🧑  作者: Mango
MemoryUsage heapMemoryUsage = ManagementFactory.getMemoryMXBean().getHeapMemoryUsage();
long maxMB = heapMemoryUsage.getMax()/(1024*1024);
long usedMB = heapMemoryUsage.getUsed()/(1024*1024);