OS VERSION: 4.2-4.4 (I am on 126.96.36.199)
HARDWARE: Xperia 10 II and III (I am on III)
UI LANGUAGE: Any (Polish)
REGRESSION: Yes, since moving from using
/dev/memnotify to cgroup’s
usage_in_bytes for newer devices
I am writing this post based on @karry’s work, I hope he doesn’t mind. This is a continuation of their comment that never got adressed, after this implementation was first introduced. They wrote an amazing blogpost about this, that explains all of it in details, I will try to summarize it all here, hope I do it well.
- Open enough apps so that some of them get killed by
- Check the MCE logs
journalctl -fe -u mce
MCE should first report an
Memory use warning, and then
Memory use critical, as can be seen by
mcetool | grep "Memory use", which could be seen in the logs.
root@Xperia10III /h/defaultuser# free -m total used free shared buff/cache available Mem: 5507 4498 322 52 687 760 Swap: 1023 693 330 root@Xperia10III /h/defaultuser# cat /sys/fs/cgroup/memory/memory.usage_in_bytes 3010162688
You can see that number that MCE uses and actual RAM used had nothing to do with each other.
Also even though system actually run out of memory, apps got closed, and Android apps got reloaded when I entered them again, even though they weren’t closed (which suggest
lkmd on Android side kicked in), no memory warning got issued by MCE. I am sure this could be solved by reducing the values for warning and critical, but the real issue is that MCE doesn’t use the metric that actually show how much physical RAM is available to be used - something that actually matters.
Could it be considered again where to poll the memory usage from, so MCE can be more useful?