Code Monkey home page Code Monkey logo

htop-mod's Introduction

htop-mod

patch(es) for htop (open source process viewer for Linux)

htop-2.1.0-pss.patch

This patch adds a

  • PSS (proportional set size) field to htop.
  • SWAP
  • SwapPss

PSS is a newish per-process memory stat in Linux (added in version 2.6.25 of the kernel) that estimates how much memory a process really uses, after taking into account how many other processes share memory with it.

Description on wikipedia

https://en.wikipedia.org/wiki/Proportional_set_size

Article on LWN

https://lwn.net/Articles/230975/

For more info please read description of /proc/PID/smaps file.

https://www.kernel.org/doc/Documentation/filesystems/proc.txt

This problem resolved now.

There's a downside to calculating PSS in htop, and that's that it causes htop to use a lot more CPU. This is because the Linux kernel doesn't provide PSS for each process in a single place but instead requires scanning the entire /proc//smaps file for each process. On my laptop with an Intel Core i3-2350M processor, htop running with the PSS patch consumes about 20% of one CPU. That's with an htop refresh rate (delay) of 1.5 seconds and about 60 processes running. More processes means more CPU use.

Performance tests

When PSS column is hidden, one cycle of LinuxProcessList_recurseProcTree took 20ms, on 181 total tasks (user/kernel threads are disabled).

When PSS column is visible, one cycle of LinuxProcessList_recurseProcTree took 200ms, on 181 total tasks, 10 times slower but not significally.

PPA

For ubuntu patched htop available here https://launchpad.net/~linvinus/+archive/ubuntu/linvinus

Screenshot

screenshot

Other

Other tools that show PSS

smem https://www.2daygeek.com/smem-linux-memory-usage-statistics-reporting-tool/#

libpagemap https://github.com/pholasek/libpagemap

there was a patch based on libpagemap for htop-0.9-3.fc16.src.rpm

https://github.com/dwks/pagemap

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.