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

Accessing only entries in /proc that are needed #74

Closed

Description

@Sworddragon

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:~$ 

Activity

  1. hishamhm commented on May 1, 2014

    @hishamhm
    Owner

    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.

  2. Sworddragon commented on May 1, 2014

    @Sworddragon
    ContributorAuthor

    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).

  3. hishamhm commented on May 1, 2014

    @hishamhm
    Owner

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions