code wiki / _hdl_build / nx_memvel.nx
nx_memvel.nx
buildroot/runtime/_hdl_build/nx_memvel.nx
about
nx_memvel.nx -- WHICH process is EATING memory, ranked by SUSTAINED growth (seq1365 / seq1376).
WHY IT EXISTS: nx_resmon ranks by MAGNITUDE, so a stable 3 GB tenant outranks a 50 MB process
doubling every minute and the real leaker hides. Measured 2026-07-30: swap 525->609 permil in 51 min
(~2.03 GB, ~40 MB/min) while the worst_committed process grew ~1 MB. LAW: a census that reports a
LEVEL cannot find a LEAK.
★★WHY IT IS N-SAMPLE (this organ's own v1 was WRONG -- seq1376): the FIRST version took ONE 5-second
window and I published its top row as a unified root cause. The very next run of the same organ put a
DIFFERENT process on top (3560 kB/s vs the previous winner's 1597) and demoted the old winner to #3.
The top slot ROTATES. A one-shot ranking of a noisy signal is a coin flip dressed as a finding -- the
exact ONE-WINDOW-IS-NOT-A-RATE defect (seq1340) committed by the author of that law, using the tool
built to prevent it. Knowing a discipline is not obeying it, so the discipline is now STRUCTURAL:
this organ CANNOT report a single-window ranking, because it no longer takes one.
★THE DECIDING COLUMN IS grew_in=k/N, NOT the rate. A real leak grows in EVERY window (k=N). A process
that tops one window and vanishes from the next is NOISE, and now says so on its own line. Rate alone
cannot distinguish them, which is precisely how v1 misled.
Rule 15: top-k, pid-join and rate arithmetic imported from nx_ctxtop_lib / nx_procchurn_lib.
Exit 0 = sampled; 3 = UNMEASURED (fail-closed).
license_tier: ORIGINAL Read-only. No hw writes (Rule 26). expect_exit: 0
dependencies 2 imports · 0 importers
imports: nx_ctxtop_lib.nxnx_proc_ctl.nx
imported by: nobody (leaf or entry point)
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| 25 | const MV_MAXP: i64 = 2048 |
| 26 | const MV_TABLE_BYTES: i64 = 16384 |
| 27 | const MV_DIRBUF: i64 = 65536 |
| 28 | const MV_STATBUF: i64 = 4096 |
| 29 | const MV_TOPK: i64 = 8 |
| 30 | const MV_TOPK_BYTES: i64 = 128 |
| 31 | const MV_ROUNDS: i64 = 5 |
| 32 | const MV_WINDOW_MS: i64 = 1200 |
| 33 | const MV_US_PER_MS: i64 = 1000 |
| 34 | const MV_NAMEOFF: i64 = 6 |
| 35 | const MV_EXIT_UNMEASURED: i64 = 3 |
| 36 | const MV_EXIT_REFUSED: i64 = 4 |
| 37 | const MV_ADMIT_DEFAULT: i64 = 800 |
| 38 | const MV_CONFBUF: i64 = 4096 |
| 39 | const MV_LOADBUF: i64 = 128 |
functions
| 43 | func mv_committed(sbuf: *u8, sn: i64) -> i64 |
| 52 | func mv_scan(pids: *i64, kbs: *i64, dbuf: *u8, path: *u8, sbuf: *u8) -> i64 |
| 93 | func mv_putname(pid: i64, path: *u8, sbuf: *u8) -> i64 |
| 115 | func main() -> i64 |