//应用程序最大可用内存 int maxMemory = ((int) Runtime.getRuntime().maxMemory())/1024/1024; //应用程序已获得内存 long totalMemory = ((int) Runtime.getRuntime().totalMemory())/1024/1024; //应用程序已获得内存中未使用内存 long freeMemory = ((int) Runtime.getRuntime().freeMemory())/1024/1024; System.out.println("---> maxMemory="+maxMemory+"M,totalMemory="+totalMemory+"M,freeMemory="+freeMemory+"M");