I need to get the memory usage of the current process in C. Can someone offer a code sample of how to do this on a Linux platform?
I\'m aware of the cat /proc/
cat /proc/
The above struct was taken from 4.3BSD Reno. Not all fields are mean- ingful under Linux. In linux 2.4 only the fields ru_utime, ru_stime, ru_minflt, and ru_majflt are maintained. Since Linux 2.6, ru_nvcsw and ru_nivcsw are also maintained.
http://www.atarininja.org/index.py/tags/code