From top/top.c :
if (Monpidsidx >= MONPIDMAX) error_exit(fmtmk(N_fmt(LIMIT_exceed_fmt), MONPIDMAX));
(where LIMIT_exceed_fmt is the error message you receive).
And in top/top.h :
#define MONPIDMAX 20
I changed this number to 80, and it seems to be working fine. I do not know why this rigidly defined limit is so low.
So, if you manually compile procps-ng , you can do it. You do not need to replace the top of the system (or use root privileges), you can just put it in your homedir.
Another workaround would be to use tmux or screen and multiple instances of top .
Another possible solution would be to use ps with a loop, i.e.
#!/bin/sh while :; do clear ps $* sleep 1 done
Call it like: ./psloop.sh 42 666
For more information, you can add additional flags in ps . Also keep in mind that this is less efficient since it will call 3 binary files every second.
Carpetsmoker Aug 14 '14 at 19:30 2014-08-14 19:30
source share