htop-dev / htop

htop - an interactive process viewer
https://htop.dev/
GNU General Public License v2.0
6.27k stars 424 forks source link

feature request: add an "available columns" to display count of fds #1478

Open lidaobing opened 3 months ago

lidaobing commented 3 months ago

Usage: when checking the fd leaks when forking, it's handy to check the number of opened file descriptors for every parent process.

How to get data: the following information means 281132 has 16 opened fds(and should have a better way to get it)

$ ls -l /proc/281132/fd | wc -l
16
BenBE commented 3 months ago

When we implemented the FD meter we briefly thought about this extra information but ultimately decided against collecting it, as this takes up a considerable amount of time to collect. Each process causes one iteration over a directory, which is in itself a slow process. Thus unless this information is available somewhere readily (in preferably a file we already process) it's unlikely to be implemented, as this will cause quite a bit of slow-down in htop.

Also, such a column should ideally be cross-platform, just like the accompanying meter is.