/**
* 获取程序内存信息
*
* @param
* @return
*/
@org.junit.Test
public void MemoryAction (){
Runtime runtime = Runtime.getRuntime();
// 获取Runtime对象实例
Map<String, Object> data = new HashMap<>();
// 创建Map集合
data.put("MaxMemorty", runtime.maxMemory());
// 数据存储
data.put("TotalMemory", runtime.totalMemory());
// 数据存储
data.put("FreeMemory", runtime.freeMemory());
// 数据存储
System.out.println(data);
}
{TotalMemory=255852544, MaxMemorty=3801088000, FreeMemory=246441848}
标签:Runtime,程序,获取,内存,put,runtime,data From: https://www.cnblogs.com/cnetsa/p/17033522.html