htop icon indicating copy to clipboard operation
htop copied to clipboard

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

Open lidaobing opened this issue 1 year ago • 1 comments

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

lidaobing avatar May 10 '24 01:05 lidaobing

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.

BenBE avatar May 10 '24 10:05 BenBE