Use Process.getRss instead of mProfile.getLastRss in CacheOomRanker.
RSS values are cached in ProcessStateRecord, and repopulated when they are >10s old. mProfile.getLastRss values can be 15s-2h stale, which is why we're using this implementation. My understanding is that the best solution would be to populate mProfile.getLastRss more often - but it is currently populated alongside PSS, which is more expensive to calculate. Therefore, rather than the more complex change of splitting up PSS & RSS collection, we opt for this simple (if not optimal) approach as CacheOomRanker is still experimental. Upon successful launch, we can revisit this. When logging the duration of CacheOomRanker calculations, we saw no significant increase in computation time with this change. If we turn off caching RSS values, we see a 10x increase in computation time. Test: atest CacheOomRankerTest Bug: 196031723 Merged-In: I8e80db2aab338df07f07842131a9d4b55bebd054 Change-Id: I8e80db2aab338df07f07842131a9d4b55bebd054 (cherry picked from commit 8bd226e3)
Loading
Please register or sign in to comment