Skip to content

Add Windows process memory support#84

Open
rushikeshsakharleofficial wants to merge 1 commit into
pixelb:masterfrom
rushikeshsakharleofficial:windows-compat-psapi
Open

Add Windows process memory support#84
rushikeshsakharleofficial wants to merge 1 commit into
pixelb:masterfrom
rushikeshsakharleofficial:windows-compat-psapi

Conversation

@rushikeshsakharleofficial

Copy link
Copy Markdown

Summary

  • Add native Windows process enumeration and memory accounting using PSAPI/kernel32 through ctypes
  • Preserve the existing Linux/FreeBSD /proc implementation
  • Add Windows-compatible handling for -p, -s, -d, -t, -w, and accepted-but-ignored -S
  • Print best-effort totals on Windows, with a warning when shared memory may be over-estimated
  • Document Windows usage and standalone .exe builds with PyInstaller

Notes

  • Windows swap usage is not reported, so -S/--swap is accepted for compatibility but does not print a fake zero-valued swap column.
  • Some protected Windows processes may require fallback memory counters, so totals can be slightly high.

Testing

  • python ps_mem.py --help
  • python ps_mem.py --version
  • python ps_mem.py -p $PID
  • python ps_mem.py -s -p $PID
  • python ps_mem.py -d -p $PID
  • python ps_mem.py -t
  • python ps_mem.py -S -p $PID
  • python ps_mem.py -t -S
  • python ps_mem.py -p nope
  • python ps_mem.py -w 0
  • one-iteration -w 1 smoke test
  • python -m py_compile ps_mem.py
  • git diff --check

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant