Skip to content
This repository has been archived by the owner on Sep 8, 2020. It is now read-only.

Accessing only entries in /proc that are needed #74

Closed
Sworddragon opened this issue Apr 29, 2014 · 3 comments
Closed

Accessing only entries in /proc that are needed #74

Sworddragon opened this issue Apr 29, 2014 · 3 comments

Comments

@Sworddragon
Copy link
Contributor

I'm using the current git of htop and it seems htop is accessing some entries in /proc even if the related columns/meters are not enabled. After disabling all columns (except "Command") and meters these entries in /proc are still accessed on a cycle:

sworddragon@ubuntu:~$ sudo inotifywait -mr /proc
Setting up watches.  Beware: since -r was given, this may take a while!
Watches established.
/proc/ OPEN meminfo
/proc/ ACCESS meminfo
/proc/ CLOSE_NOWRITE,CLOSE meminfo
/proc/ OPEN stat
/proc/ ACCESS stat
/proc/ CLOSE_NOWRITE,CLOSE stat
/proc/ OPEN,ISDIR 
/proc/1/ OPEN,ISDIR task
/proc/1/task/ OPEN,ISDIR 
/proc/1/ CLOSE_NOWRITE,CLOSE,ISDIR task
/proc/1/task/ CLOSE_NOWRITE,CLOSE,ISDIR 
/proc/1/ OPEN statm
/proc/1/ ACCESS statm
/proc/1/ CLOSE_NOWRITE,CLOSE statm
/proc/1/ OPEN stat
/proc/1/ ACCESS stat
/proc/1/ CLOSE_NOWRITE,CLOSE stat
/proc/1/ OPEN cmdline
/proc/1/ ACCESS cmdline
/proc/1/ CLOSE_NOWRITE,CLOSE cmdline
...
/proc/ CLOSE_NOWRITE,CLOSE,ISDIR 
^Csworddragon@ubuntu:~$ 
@hishamhm
Copy link
Owner

hishamhm commented May 1, 2014

Why would you want to disable all columns except Command? I won't add complexity to the codebase just to serve that weird scenario that I've never seen anyone in real life using. It's a safe bet that 99% of users keep memory information active.

@Sworddragon
Copy link
Contributor Author

Why would you want to disable all columns except Command?

For a test to look if htop makes optimizations in all cases if specific columns/meters are disabled. I got the idea after this statement:

One optimization I already perform is to avoid collecting some data if columns are not selected (in particular this is done for IO stats).

@hishamhm
Copy link
Owner

hishamhm commented May 1, 2014

For a test to look if htop makes optimizations in all cases if specific columns are disabled.

It was obvious to me that you did it for testing. The question was if you'd ever do it in real life. So now you know, it does not do that, because there's a cost vs return-of-investment in the implementation of every optimization. Those are optimizations that I don't consider worth it because mostly nobody disables memory meters.

I don't think that's an issue with htop, so I'm closing this.

@hishamhm hishamhm closed this as completed May 1, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants