code wiki / _hdl_build / nx_memvel.nx

nx_memvel.nx

buildroot/runtime/_hdl_build/nx_memvel.nx

9647 B206 linesdepth 5pulls 6 transitivereach 0 importersview sourcekind tool
docsdependenciesstructsconstsfunctions

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

nx_ctxtop_lib.nx nx_proc_ctl.nx nx_memvel.nx

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

main rm_conf rm_field rm_slen ct_load_centi ct_admit sys_now_us sys_mmap sys_clock_gettime_mono mv_scan sys_getdents64 dirent_reclen dirent_name mv_committed rm_field ↻ sys_sleep_ms sys_mmap ↻ sys_munmap ct_find ct_topk_insert pc_rate mv_putname pc_catn sys_munmap ↻ sys_munmap ↻

structs

none

consts

25const MV_MAXP: i64 = 2048
26const MV_TABLE_BYTES: i64 = 16384
27const MV_DIRBUF: i64 = 65536
28const MV_STATBUF: i64 = 4096
29const MV_TOPK: i64 = 8
30const MV_TOPK_BYTES: i64 = 128
31const MV_ROUNDS: i64 = 5
32const MV_WINDOW_MS: i64 = 1200
33const MV_US_PER_MS: i64 = 1000
34const MV_NAMEOFF: i64 = 6
35const MV_EXIT_UNMEASURED: i64 = 3
36const MV_EXIT_REFUSED: i64 = 4
37const MV_ADMIT_DEFAULT: i64 = 800
38const MV_CONFBUF: i64 = 4096
39const MV_LOADBUF: i64 = 128

functions

43func mv_committed(sbuf: *u8, sn: i64) -> i64
called by 1: mv_scan calls 1: rm_field
52func mv_scan(pids: *i64, kbs: *i64, dbuf: *u8, path: *u8, sbuf: *u8) -> i64
93func mv_putname(pid: i64, path: *u8, sbuf: *u8) -> i64
called by 1: main calls 2: pc_catnsys_munmap
115func main() -> i64