Crates.io | max_rss |
lib.rs | max_rss |
version | 0.4.1 |
source | src |
created_at | 2024-01-15 09:56:01.108953 |
updated_at | 2024-01-18 02:22:20.121055 |
description | A small utility to measure resident set size (rss) of a process |
homepage | https://github.com/acheronfail/max_rss |
repository | https://github.com/acheronfail/max_rss |
max_upload_size | |
id | 1100197 |
size | 67,527 |
max_rss
A small utility to measure resident set size (rss) of a process.
I created this because the I wanted to track the memory usage of programs in https://github.com/acheronfail/count, but the max_rss
value from Linux's getrusage
is inaccurate.
It uses Linux's ptrace api (man 2 ptrace
) and tracks when the process forks, clones or exits, and sums up the Resident Set Size from each process where appropriate.
If you go through various Linux man pages, you'll discover that the max_rss
field from getrusage
isn't accurate, and also that man 5 proc
mentions its rss
field and some others are inaccurate. It recommends reading /proc/$PID/smaps
instead.
Hence the need for this program. Here are also some other people I've found encountering the same thing: