public static float getMaxMemory () {
Return the Runtime. GetRuntime (). MaxMemory ()/1024 f/1024 f.
}
public static ActivityManager. MemoryInfo getMemoryInfo (Context Context) {
If (the context==null) {
return null;
}
ActivityManager. MemoryInfo mi=new ActivityManager. MemoryInfo ();
((ActivityManager) context. GetSystemService (context. ACTIVITY_SERVICE)). GetMemoryInfo (mi);
Return the mi;
}
val manager=(enclosing getSystemService (Context. ACTIVITY_SERVICE) as ActivityManager)
Val heapGrowthLimit=manager. MemoryClass
After tests found that the return of maximum available memory is 512 m, but, I in the Android Studio by looking at the inside of the profiler memory module, you can see my app has more than 1 gb of memory
Clear and 512 m not ah, that what can get the largest number of memory?
CodePudding user response:
Mobile phone deposit is 8 g