Linux内核有一个功能,可以通过将1/2/3
写入/proc/{pid}/reclaim
来回收进程内存https://lwn.net/Articles/548431/.但当我检查当前的Android源代码时,它并不存在。所以我想知道这样的功能是否已经被弃用或移动了?
最后我想我从提交消息中找到了原因:
https://android-review.googlesource.com/c/platform/frameworks/base/+/1730078
Edgar Arriaga Edgar Arriaga, a year ago (August 13th, 2020 4:03am)
Migrate to use process_madvise syscall instead of procfs interface for memory compaction
Currently the system uses procfs and we are migrating to use a syscall called process_madvise
which makes the code upstreamable and will allow for making compaction widely available for multiple
android devices.
It also opens room for future developments that involve a finer grain VMA compressions
than the current procfs allows.