Getting the Resident Set Size is straightforward (getrusage() or /proc/self/statm), but how do I get the amount of swap? From man 5 proc about /proc/self/stat:
nswap %lu Number of pages swapped (not maintained).
cnswap %lu Cumulative nswap for child processes (not maintained).
Any other thoughts?