Sample Header Ad - 728x90

Are there any alternatives to pidof? (smaller footprint)

2 votes
3 answers
4637 views
Well, I've just found out that with extensive usage of pidof in __very short intervals__, the seemingly tiny tool can be a great __CPU hog__. (Source: top) On my older machine, it can easily reach 30 percent peaks especially in batch usage, though only for a short time, but I think that for a simple task like finding the PID of a process, the footprint of such tool should be one fifth of pidof's (if at all). That is also why I wonder if it might be more sensible to "construct" the finding of the process ID with built-in standard tools. It would not be surprising to me if the *sum* of CPU load caused by executing the whole pipe managed to stay *below* the load caused by running pidof standalone. Furthermore, it would be interesting to know *what* is causing these high peaks. Maybe there is even somebody here amongst you guys who has dug a little deeper into the pidof code? :)
Asked by syntaxerror (2426 rep)
Oct 22, 2014, 06:47 PM
Last activity: Jul 12, 2019, 08:46 PM