docs/agents/office-tunnel-memory-note.md
During the ARM Desktop audit on 2026-05-03, run_tunnel.py was the clearest near-future memory optimization candidate. The process held roughly 573 MiB PSS while the main UI process held roughly 706 MiB PSS, even though the tunnel should mostly be a lightweight network edge.
run_tunnel.py imports enough of the framework stack to pull in heavy provider and API dependencies.ApiHandler or helper imports used by the tunnel path and replace broad framework imports with narrower functions.smem -P run_tunnel.py, /proc/<pid>/smaps_rollup, and before/after cold-start RSS/PSS on ARM64.The tunnel process should remain useful as an always-on edge while dropping its idle PSS substantially below the main UI process. A good first target is under 250 MiB PSS on ARM64 without changing tunnel behavior.