Profiling kube-apiserver memory consumption and allocation churn in isolation is challenging: microbenchmarks only exercise a single function at a time, while full cluster e2e tests introduce external network jitter, node-agent background noise, and non-deterministic garbage collection timing.
TestAPIServerMemoryIntegration (cmd/kube-apiserver/app/testing/apiserver_mem_bench_test.go) is a self-contained, deterministic in-process kube-apiserver + embedded etcd3 integration benchmark designed to measure both steady-state retained heap memory (pprof inuse_space, HeapInuse, HeapObjects, process RSS) and cumulative request allocation churn (pprof alloc_space, TotalAlloc, Mallocs, NumGC) with zero external dependencies.
![In-Process Benchmark Architecture and Request Flow](https://gist.githubusercontent.com/mauriciopoppe/508635e973bb8795cab2241c9a520edc/raw/kcp_