get the process resident set size (physical memory use).
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
README.md
getRSS.c

README.md

getRSS

This code is the backup of getRSS.c whose link is broken now. This file provides 2 APIs:

/* get the current resident set size, in bytes, of the current process */
size_t currentSize = getCurrentRSS( );

/* get the peak resident set size, in bytes, of the current process */
size_t peakSize = getPeakRSS( );

If you use it on Winodows, you should link it with psapi.lib.

The other thing you should pay attention is for GetProcessMemoryInfo and getrusage, the code doesn't check return value. So if you use it, I think it is a good habit to check the return value.