58,454
社区成员
发帖
与我相关
我的任务
分享
public class Test {
public static void main(String []src){
byte[] b = new byte[1024*1024*63];
}
}
import java.lang.Runtime;
public class Test {
public static void main(String []src){
byte[] b = new byte[1024*1024*669];
System.out.println(Runtime.getRuntime().maxMemory());
System.out.println(Runtime.getRuntime().totalMemory());
System.out.println(Runtime.getRuntime().freeMemory());
System.out.println(Runtime.getRuntime().totalMemory()-Runtime.getRuntime().freeMemory());
}
}