My program wants to detect how much memory it's using & issue a warning if it goes larger than a threshold. I don't care about memory that has been allocated but never accessed, since that's not backed by either RAM or swap. How do I get the total RAM + swap used by my process? Does "resident set size" include swap?
Edit: As others have pointed out, getting the resident size is easy, but doesn't include swap. So this question is really about how to get the amount of swap used by a process.