public class Test { public static void main(String[] args) throws UnsupportedEncodingException { Runtime r = Runtime.getRuntime();//获取Runtime实例 p(r.freeMemory());//剩余内存 p(r.totalMemory()/1024/1024);//总内存 p(r.maxMemory()/1024/1024);//最大可用内存 p(r.availa…