1. 17
  1.  

  2. 5

    This is a nice effort, but one wonders why the author doesn’t want to use vmstat(8).

    Side note: The author doesn’t seem to be too familiar with OpenBSD and its conventions. The man page was written in man(7), which is deprecated in favor of mdoc(7) on OpenBSD

    1. 3

      Thanks for educating me about the distinction: https://github.com/blinkkin/blinkkin.github.com/wiki/man-vs-mdoc

      1. 4

        I’d suggest Practical UNIX Manuals for introductionary reading for mdoc, too: https://manpages.bsd.lv/mdoc.html

      2. 3

        Thanks very much for your pointing out to use mdoc!

        Compared to vmstat(8), my simple toy has following differences:
        (1) Add displaying swap space;
        (2) Only consider active pages as “used” memory, others are all counted as “free” memory.IMHO, for the end user who doesn’t care the guts of Operating System, maybe this method is more plausible?

        All in all, I just write a small tool for fun, and thanks very much again for giving pertinent advice!

        1. 2

          Agreed. Sometimes you don’t really care about everything vmstat offers. free is dirty neat :)

          • TIL about mdoc
          1. 1

            P.S. After some testing, I modify the calculating free method just now: use free pages as “free” memory, then others are considered as “used” memory.