Add vmPSS to Process and display it as "total memory" column
ClosedPublic

Authored by ahiemstra on Aug 23 2019, 5:56 PM.

Details

Summary

This adds a "proportional state set" value to ProcessCore::Process, that is then
exposed as "Total Memory" column in KSysGuard. This column is hidden by default.

PSS is the amount of memory a process uses privately + the amount of shared memory
divided by the amount of processes sharing that memory. It is, as far as I know, the
closest we can get to "total physical memory usage" for a process.

The value for PSS is read from /proc/{pid}/smaps_rollup . This unfortunately means
we cannot currently display PSS for processes not owned by the current user, as
smaps_rollup is not world-readable.

For some background on this, see https://lkml.org/lkml/2017/8/9/1073 , which is the
patch that adds smaps_rollup and talks about what Android uses it for.

Test Plan

Run ksysguard, then toggle display of the "Total Memory" column. Values should be
higher than the "Memory" column.

Diff Detail

Repository
R111 KSysguard Library
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
ahiemstra created this revision.Aug 23 2019, 5:56 PM
Restricted Application added a project: Plasma. · View Herald TranscriptAug 23 2019, 5:56 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
ahiemstra requested review of this revision.Aug 23 2019, 5:56 PM
davidedmundson accepted this revision.Aug 26 2019, 9:53 AM
This revision is now accepted and ready to land.Aug 26 2019, 9:53 AM
This revision was automatically updated to reflect the committed changes.