wtop

michaelsanford·michaelsanford.wtop

Windows re-imagining of htop, written in Go

A self-contained, single-binary system monitor for Windows — inspired by htop. CPU, memory, GPU, network, and processes. Live. In your terminal.

winget install --id michaelsanford.wtop --exact --source winget

Latest 1.3.1·October 19, 2026

Release Notes

Fixed: wtop used ~5.7 GB of RAM from the moment it launched v1.3.0 showed itself at the top of its own process list: about 5.7 GB working set and 9.8 GB private memory (around 18% of RAM on a 32 GB machine), reached within a second of launch. Upgrading is recommended for every v1.3.0 user. The bug affects all machines. What was happening This was not a leak. Memory jumped once at startup and then stayed flat. GODEBUG=gctrace=1 showed the Go heap doubling every ~30 ms until about 7.3 GB was live. A heap profile put 9.5 GB (99.9% of all allocations) in the per-core CPU collector. wtop reads per-core CPU times with NtQuerySystemInformation(SystemProcessorPerformanceInformation). This call rejects any buffer whose length is not a whole number of 48-byte per-core entries, returning STATUS_INFO_LENGTH_MISMATCH. The buffer was sized NumCPU × 48 + 4096, with the extra 4 KB meant as headroom. That headroom made every call fail. The retry loop responded by doubling the buffer, but 4096 · 2ᵏ is never divisible by 3, so no amount of doubling could produce a valid length. The loop stopped only by coincidence. The length parameter is a 32-bit ULONG, and on a 16-thread machine, after 20 doublings (4864 · 2²⁰ ≈ 5.1 GB), the value truncated to 0x30000000, which happens to be a multiple of 48. The call then succeeded, and the ~5 GB buffer was kept for reuse for the rest of the session. How far it grew before that coincidence depended on the machine's core count. The fix (#45)

  • The CPU buffer is now sized to exactly one entry per logical processor and only ever grows in whole entries. The loop uses the kernel's reported length when it is a whole number of entries, and is capped at 4,096 cores (~192 KB). Past the cap it returns an error instead of allocating.
  • The process-table query had the same uncapped doubling loop. It wasn't misbehaving, since that info class has no entry-size rule, but it now has a 64 MB cap so it can't run away either.
  • A new regression test (TestCPUBufferStaysBounded) checks that the buffer stays a whole number of entries, stays under the cap, and still covers every core. Before / after ──────┬─────────────┬────────┬──────────── │Working set │Private │Live Go heap

──────┼─────────────┼────────┼──────────── v1.3.0│5,704 MB │9,816 MB│7,297 MB ──────┼─────────────┼────────┼──────────── v1.3.1│~65 MB (flat)│~63 MB │1–3 MB ──────┴─────────────┴────────┴──────────── Allocations for the first CPU collection fell from 9.51 GB to 4.3 MB. Most of the remaining footprint is native code (GPU driver and performance-counter DLLs), not wtop's own heap. What's Changed

  • fix(verify): isolate downloads per tag and add -Clean by @michaelsanford in #43
  • Remove Snyk scanning by @michaelsanford in #44
  • fix(collector): stop the CPU buffer growing to ~5 GB at startup by @michaelsanford in #45 Full Changelog: v1.3.0...v1.3.1

Installer type: portable

x64—1C65245EFD351633EB17FEB1C067E4B1D1B2D51AF04A76D1657960243DDABF0C
arm64—25BEDCA42D05084F40A82972915CF412966383E38AC5E3523C66A879F342274A

Details

Homepage
https://www.michaelsanford.com/wtop/
License
MIT
Publisher
michaelsanford
Support
https://github.com/michaelsanford/wtop/issues

Tags

golanghtop-alternativeterminal-basedwindows

Older versions (4)

1.3.0
x64—0D99623B33B7FD93E48568593648C4D4108B51F98DCCDA6A3072B97F5F6D102D
arm64—A9CB44A248A10251E71E1B24528E99F8077C507F8D2C18D280E234856D5E5542
1.2.1
x64—09AF965B4CC94E399E29FA26BD7EBE1B626A1B5DF52AC00A32C9A4FCA9977802
arm64—9B5B2203E227A9C4C761AE0A1666AECCCE49677AE6EEC001FD9FDC0B78D02302
1.2.0
x64—C0C8CD2A8792A5A034F5CA23020D7AFE77E107AE9A4789BF738B8E912898333B
arm64—1DB7DD54509A310DCF30356FE858D80818E06248DF3636E7DDB2B4BC240B7A33
1.1.0.0
x64—F0394BBF1F6A21B624C6B238D0403F61B3A3CC79941562234A76C43033A04A25
arm64—6EAB8722256842D360CA360BF1BC1AE299EBFFC87060B75E4962CAAAD435224B