Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use /proc/<pid>/smaps to calculate mem on linux to allow usage of PSS. #2

Merged
merged 1 commit into from
Apr 1, 2014

Conversation

ksoderstrom
Copy link
Contributor

This PR changes the behavior of the Linux memory calculation to use /proc/<pid>/smaps instead of /proc/<pid>/status. This allows the user to request either RSS or PSS memory. PSS is the process' proportional share of the mapping that is resident in RAM and is calculated by the Linux kernel.

The default value is still rss, and pss is only compatible with Linux.

schneems added a commit that referenced this pull request Apr 1, 2014
Use /proc/<pid>/smaps to calculate mem on linux to allow usage of PSS.
@schneems schneems merged commit ebf5c59 into zombocom:master Apr 1, 2014
@schneems
Copy link
Member

schneems commented Apr 1, 2014

❤️ thanks again for this! One thing i noticed is that ps command doesn't have a pss report. I'm thinking that we should default the metric to report to pss on linux, and return rss always on a mac as there's no equivalent pss (that I can find).

@ksoderstrom
Copy link
Contributor Author

Right, I couldn't find any alternatives for OS X. I suppose it would be possible to calculate it, since it's more or less based on shared pages / num processes sharing it. Not sure if it's possible to get that from ps though.

Changing the default for linux might make sense. I felt it would be a bit ugly to get totally different results with default options on different platforms, but I can create a PR if you want to.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants