-1

How does HTOP gather information like CPU consumption, memory consumption etc by every process and the whole system? I am not familiar with any operating system specific api (like socket api) that is provided by linux in order to gather those statistics.

1 Answers1

0

Well, I'd point you to the htop sources, first.

Then, operating systems like Linux have a lot of interfaces to get those information. Some of these metrics are available via the classical /proc pseudo-filesystem, or via /sys/; others might be only available via ioctls or specific system calls (e.g. getgid).

Marcus Müller
  • 34,677
  • 4
  • 53
  • 94