> Outcome (added when this file was published, 2026-11-13): verified, S4, narrowed: settle
From mnema-talk v3.3.13, rendered on this site.
ID: H-L8-05, lane 8, severity S4, status: reproduced (pending phase 2)
Claim: A member's SFU connection keeps memory for every other member who joined and left the Talk while it was connected: measured 11 to 31 KB per departed member, not released until that connection ends. All SFU maps, the goroutine count and the connection's transceivers and SDP stay at baseline.
Property: Plainly intended (brief lane 8, "nothing keyed by remote input grows without bound"): when a publisher leaves, the state the SFU built on each viewer's connection for that publisher's stream is released. The room maps are (rooms, peers, trackLocals, latestSources, groups, subs, lastMedia, lastViewers, layerMeta, conns are all back at baseline); the viewer connection's memory is not.
Repro (clean checkout of msch128/hunt-lane8, commit 532819d4b ): SFU_CYCLE_ROUNDS=1200 go test ./internal/sfu/ -run TestSFUJoinLeaveCycleReturnsToBaseline -v -timeout 15m Expected: heap in use after the cycle within the fixed pool warm-up (3 to 6 MB, which the 2000-round open/close cycle stays inside). Actual: one resident member, N members join over real loopback connections, publish a microphone the resident receives, and leave: 400 joiners: +12.1 MB; 500: +13.9 MB; 1200: +36.9 MB (30.8 KB/joiner); 2000: +30.6 MB. Transceivers of the resident's connection 8 -> 8, its SDP about 27 KB before and after; goroutines 50 -> 50; every SFU map at baseline. Control: TestSFURoomOpenCloseCycleReturnsToBaseline (both members leave each round, so every connection ends) stays within the bound at 2000 rounds: the memory is released when the viewer's connection ends. The test's deep branch (rounds >= 1000) is an inverse assertion: it asserts at least 4 KB retained per joiner and turns red when the retention is gone.
Minimal: not shrunk below "one resident, many joiners".
Attribution (heap profile, base vs end, MemProfileRate 1024): per departed stream on the resident's connection: a new RTPSender (the transceiver is reused, its sender is new), Pion's stats recorder (stats.newRecorder), an SRTCP read stream and packetio buffers (srtp ReadStreamSRTCP.init, packetio.NewBuffer), report/twcc/gcc stream state, and our passPacer entry (H-L8-03). Pion's stats interceptor deletes its recorder on UnbindLocalStream (refcounted), so which reference keeps these alive is NOT determined. Part may be third-party.
Reach: no attacker needed; any Talk with churn. Bounded by the viewer's connection lifetime and the number of joins it sees; join churn is limited per user (voiceGate burst 3, 1/s) but not per room. Example: a resident in a Talk that sees 1000 joins carries 11 to 31 MB more; every resident pays it.
Effect: SFU memory grows with the length and churn of long Talks; released when members leave. Not measured on a production build or with video.
Not shown: the exact retaining reference; video tracks and simulcast layers (only audio); whether a renegotiation that reuses senders would avoid it.
Fix (direction only): find the retaining reference (start from H-L8-03's passPacer, which keeps the writer chain of each old SSRC, then the SRTCP read streams of stopped senders); release per-stream state on UnbindLocalStream / sender stop. internal/sfu is a protected area: prepare only.
Cross-reference: H-L8-07 measures the same Pion path driven on purpose (srtp session.readStreams and undeclaredRTCPMediaProcessor's unhandledStreams, kept until the PeerConnection closes); a candidate for this finding's retaining reference.
Reviews: reproducer -, refuter - (pending phase 2). Files: internal/sfu/cycle_leak_test.go, internal/sfu/sfu_test.go (test helper: release(), stopPublishing())