我自己的测试结果大概是10兆,不知道对不对?我是通过这样查看的,不知道对不对?
System.gc();
Runtime rt = Runtime.getRuntime();
System.out.println("总内存="+rt.totalMemory()+", 已用="+(rt.totalMemory()-rt.freeMemory())+", 可用="+rt.freeMemory()+", 最大="+rt.maxMemory());我老是怀疑自己用的内存没有释放掉,感觉当已用的内存接近10兆时,表示自己开销的内存基本回收了,是不是这样呢?