[fpc-pascal] How to get info about CPU and Memory usage?

Michael Van Canneyt michael at freepascal.org
Wed Feb 27 17:49:45 CET 2013



On Wed, 27 Feb 2013, Krzysztof wrote:

> Hi,
> I need system info such CPU (by PID), memory usage (by PID), free memory etc. Target platform: Linux.
> Linux have command line tools like ps, top, memstat, but I'm just wondering if Free Pascal has wrappers for these commands. If
> not, then I just get these information by execution external process.

This is becoming a FAQ. :-)

There are no such units AFAIK, and executing an external process for this is not recommended.

It is better to simply parse 
/proc/cpuinfo
and
/proc/PID/*

Michael.



More information about the fpc-pascal mailing list