一、Runtime
long heapsize = Runtime.getRuntime().totalMemory()
二、ActivityManager
ActivityManager manager = (ActivityManager)getSystemService(Context.ACTIVITY_SERVICE);
int heapSize = manager.getMemoryClass();
long heapsize = Runtime.getRuntime().totalMemory()
ActivityManager manager = (ActivityManager)getSystemService(Context.ACTIVITY_SERVICE);
int heapSize = manager.getMemoryClass();