How to find memory usage at run time

Vishal vishal at mail.cyberneme.com
Sun Apr 4 10:33:50 PDT 2004


 
 In certain part of my code i need to have the overall usage of Physical Memory at run-time.

 I am looking for the structure which writes the information in /proc/meminfo

 like when i do

 [vishal at otl027 glibc-2.3.2-200310271512]$ cat /proc/meminfo

 MemTotal:       515616 kB
 MemFree:        474676 kB
 Cached:          25060 kB
 SwapCached:          0 kB
  
 and so on ...

 I am trying to look into "top" utility's source code , which i got frm procps-3.2.1.tar.gz,

 but has not got much success. 

 If anyone happens to use this i.e 

 the structure and member which writes MemFree in /proc/meminfo.

 Kindly lemme know, it wud be very helpful 4 me.


 Regards,

 Vishal.




More information about the blfs-support mailing list