max_rss

Crates.iomax_rss
lib.rsmax_rss
version0.4.1
sourcesrc
created_at2024-01-15 09:56:01.108953
updated_at2024-01-18 02:22:20.121055
descriptionA small utility to measure resident set size (rss) of a process
homepagehttps://github.com/acheronfail/max_rss
repositoryhttps://github.com/acheronfail/max_rss
max_upload_size
id1100197
size67,527
(acheronfail)

documentation

README

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.

How does it work?

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:

Commit count: 0

cargo fmt