LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Gathering Memory Statistics (https://www.linuxquestions.org/questions/programming-9/gathering-memory-statistics-209023/)

basu_arani 07-24-2004 02:49 AM

Gathering Memory Statistics
 
I want to program a memory monitoring system, which gathers information regarding, which process is being allocated with the memory dynamically.

What is the procedure to collect the memory statics of a particular process.

This program is being programmed in Red Hat Linux 9 with kernel version 2.4

Kindly Help.

itsme86 07-24-2004 02:57 AM

Your best bet is to intercept malloc(), free(), etc. to monitor what's going on. There's already a lot of these programs out there if you're not really looking to learn how, but just want the functionality. If you just want to find the data segment's break point you can look at /proc/<pid>/status. There's some memory information in there for each process, but the values only grow in <page_size> chunks.


All times are GMT -5. The time now is 08:22 PM.