Skip to main content

list process' PSS sorted descendingly within their parent-child hierarchy. can also do same for disk-space usage

Project description

PSS-tree

# python -m psstree --help

usage: __main__.py [-h] [--expand] [--full] [--raw] [--du PATH] [--all]

gets process' PSS via /proc/<PID>/smaps(_rollup), sorts it descendingly within their parent-child hierarchy, and displays it in an interactive TUI with collapsible sections. alternatively can do the same for disk-space usage given a root-path

options:
  -h, --help  show this help message and exit
  --expand    [TUI only] expand all collapsible sections at start
  --full      show full description
  --raw       disable TUI and dump formatted repr directly to stdout
  --du PATH   report disk space instead, for given root-path
  --all       [du only] include content inside certain dirs: site-packages, and ones starting with '.' (like .git) [the dirs themselves are not omitted]

# python -m psstree --raw

Proportional Set Size (PSS) "[<total-PSS-including-all-children>] command-name(pid): `<individual-PSS>` <full-cmdline-args>"
 ╭─[16.12MB] bash(7): `2.07MB` 
 │  ├─[13.41MB] python(705): `13.41MB` 
 │  ├─[0.32MB] sleep(703): `0.32MB` 
 │  ╰─[0.32MB] sleep(704): `0.32MB` 
 ╰─[2.14MB] bash(1): `1.51MB` 
    ├─[0.32MB] sleep(700): `0.32MB` 
    ╰─[0.31MB] sleep(702): `0.31MB` 

# python -m psstree --raw --full

Proportional Set Size (PSS) "[<total-PSS-including-all-children>] command-name(pid): `<individual-PSS>` <full-cmdline-args>"
 ╭─[16.12MB] bash(7): `2.07MB` bash
 │  ├─[13.41MB] python(706): `13.41MB` python -m psstree --raw --full
 │  ├─[0.32MB] sleep(703): `0.32MB` sleep 100
 │  ╰─[0.32MB] sleep(704): `0.32MB` sleep 100
 ╰─[2.14MB] bash(1): `1.51MB` bash
    ├─[0.32MB] sleep(700): `0.32MB` sleep 100
    ╰─[0.31MB] sleep(702): `0.31MB` sleep 100

# python -m psstree --raw --du .

Disk-Space usage "[<total-space-including-subdirs-recursively>] <path>"
 ╶─[0.527MB] .
    ├─[0.375MB] .git/*
    ├─[0.113MB] src
    │  ├─[0.094MB] psstree
    │  │  ├─[0.070MB] __pycache__/*
    │  │  ├─[0.008MB] types.py
    │  │  ├─[0.008MB] utils.py
    │  │  ├─[0.004MB] tui.py
    │  │  ╰─[0.004MB] __main__.py
    │  ╰─[0.020MB] psstree.egg-info
    │     ├─[0.004MB] PKG-INFO
    │     ├─[0.004MB] SOURCES.txt
    │     ├─[0.004MB] requires.txt
    │     ├─[0.004MB] top_level.txt
    │     ╰─[0.004MB] dependency_links.txt
    ├─[0.016MB] dist
    │  ├─[0.008MB] psstree-0.1.2.tar.gz
    │  ╰─[0.008MB] psstree-0.1.2-py3-none-any.whl
    ├─[0.004MB] LICENSE
    ├─[0.004MB] Makefile
    ├─[0.004MB] pyproject.toml
    ├─[0.004MB] README.md
    ├─[0.004MB] .gitignore
    ├─[0.004MB] .github/*
    ╰─[0.000MB] images

# python -m psstree --raw --du . --full

Disk-Space usage "[<total-space-including-subdirs-recursively>] <path>"
 ╶─[0.527MB] .
    ├─[0.375MB] ./.git/*
    ├─[0.113MB] ./src
    │  ├─[0.094MB] ./src/psstree
    │  │  ├─[0.070MB] ./src/psstree/__pycache__/*
    │  │  ├─[0.008MB] ./src/psstree/types.py
    │  │  ├─[0.008MB] ./src/psstree/utils.py
    │  │  ├─[0.004MB] ./src/psstree/tui.py
    │  │  ╰─[0.004MB] ./src/psstree/__main__.py
    │  ╰─[0.020MB] ./src/psstree.egg-info
    │     ├─[0.004MB] ./src/psstree.egg-info/PKG-INFO
    │     ├─[0.004MB] ./src/psstree.egg-info/SOURCES.txt
    │     ├─[0.004MB] ./src/psstree.egg-info/requires.txt
    │     ├─[0.004MB] ./src/psstree.egg-info/top_level.txt
    │     ╰─[0.004MB] ./src/psstree.egg-info/dependency_links.txt
    ├─[0.016MB] ./dist
    │  ├─[0.008MB] ./dist/psstree-0.1.2.tar.gz
    │  ╰─[0.008MB] ./dist/psstree-0.1.2-py3-none-any.whl
    ├─[0.004MB] ./LICENSE
    ├─[0.004MB] ./Makefile
    ├─[0.004MB] ./pyproject.toml
    ├─[0.004MB] ./README.md
    ├─[0.004MB] ./.gitignore
    ├─[0.004MB] ./.github/*
    ╰─[0.000MB] ./images

# python -m psstree --raw --du src/psstree

Disk-Space usage "[<total-space-including-subdirs-recursively>] <path>"
 ╶─[0.094MB] psstree
    ├─[0.070MB] __pycache__/*
    ├─[0.008MB] types.py
    ├─[0.008MB] utils.py
    ├─[0.004MB] tui.py
    ╰─[0.004MB] __main__.py

# python -m psstree --raw --du src/psstree --all

Disk-Space usage "[<total-space-including-subdirs-recursively>] <path>"
 ╶─[0.094MB] psstree
    ├─[0.070MB] __pycache__
    │  ├─[0.016MB] utils.cpython-311.pyc
    │  ├─[0.012MB] utils.cpython-314.pyc
    │  ├─[0.012MB] types.cpython-311.pyc
    │  ├─[0.008MB] utils.cpython-39.pyc
    │  ├─[0.008MB] tui.cpython-311.pyc
    │  ├─[0.004MB] __main__.cpython-39.pyc
    │  ├─[0.004MB] tui.cpython-39.pyc
    │  ├─[0.004MB] __main__.cpython-314.pyc
    │  ╰─[0.004MB] __main__.cpython-311.pyc
    ├─[0.008MB] types.py
    ├─[0.008MB] utils.py
    ├─[0.004MB] tui.py
    ╰─[0.004MB] __main__.py

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

psstree-0.3.0.tar.gz (8.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

psstree-0.3.0-py3-none-any.whl (9.1 kB view details)

Uploaded Python 3

File details

Details for the file psstree-0.3.0.tar.gz.

File metadata

  • Download URL: psstree-0.3.0.tar.gz
  • Upload date:
  • Size: 8.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for psstree-0.3.0.tar.gz
Algorithm Hash digest
SHA256 e009661ce95e417309b45696deee016897415bb3ac81bc49824a19fab8f2dfd6
MD5 45d30c1e6cf6ad6386a396d3f6d99c4b
BLAKE2b-256 c55840b5fbf658eb9c87853746041a122c52ae11b8138e282e33adc2142ded46

See more details on using hashes here.

File details

Details for the file psstree-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: psstree-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 9.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for psstree-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 08801a56e6e9fc2c087da4808fc842d5e3778802bc8218c50ee38505c41050a7
MD5 ad2c720c06cd74b99400172d82d23f93
BLAKE2b-256 dbe06a1f71cd79783e685ef73ac7d931bf6e405f332f7da378550e825bcdae01

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page