mirror of
https://github.com/M66B/FairEmail.git
synced 2025-12-28 00:20:50 +01:00
Log free heap memory
This commit is contained in:
@@ -614,4 +614,15 @@ public class Helper {
|
||||
bundle.writeToParcel(p, 0);
|
||||
return p.dataSize();
|
||||
}
|
||||
|
||||
static long getFreeMem() {
|
||||
Runtime rt = Runtime.getRuntime();
|
||||
long used = (rt.totalMemory() - rt.freeMemory());
|
||||
long max = rt.maxMemory();
|
||||
return (max - used);
|
||||
}
|
||||
|
||||
static int getFreeMemMb() {
|
||||
return (int) (getFreeMem() / 1024L / 1024L);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user