We run a long-lived kiosk, which suffice sequential 1:1 sessions on a single page (the page is not reloaded between sessions). For each session, we create a client, initialize, join, start audio/video, and at session end we detach everything, call leave(), and await ZoomVideo.destroyClient().
The renderer never returns to its pre-session memory footprint. Every completed session leaves ~70–80 MB of JS heap behind in SDK-created contexts. Over time, memory accumulates linearly and is never reclaimed by idle time (observed for 2-3 hours atleast) or forced GC.
We have two primary questions:
What is the supported way to release it at session end?destroyClient() does not clean it up, and we haven’t found a public API that does. There are 2 things left post call end one is ‘call’ which is around 22 MB or more and ‘vb_worker’ which is around 48-50 MB.
Why is a worker named vb_worker created per client when Virtual Background is never used? No VB option is passed to startVideo, no background image is set, and VB APIs aren’t called anywhere in our code. Yet a TF.js worker named vb_worker (~50 MB, containing a selfie-segmentation model) is spawned on the first join of every client, with a new one accumulating for every session.
Browser Console Error
There is no error, and no warning during teardown—destroyClient() resolves successfully without logging anything.
Which Web Video SDK version?
2.4.0 (We also statically inspected the 2.5.0 bundle; the relevant teardown logic appears identical).
Video SDK Code Snippets
The trimmed-down per-session lifecycle (SDK calls only):
import ZoomVideo from '@zoom/videosdk'
// --- 1. Setup ---
const client = ZoomVideo.createClient()
ZoomVideo.preloadDependentAssets()
await client.init('en-US', 'CDN', { stayAwake: true, leaveOnPageUnload: true })
await client.join(topic, signature, userName)
const stream = client.getMediaStream()
await stream.startAudio()
await stream.startVideo({ hd: true })
await stream.attachVideo(remoteUserId, VideoQuality.Video_720P)
// --- 2. Teardown ---
const players = await stream.detachVideo(remoteUserId)
players.forEach((el) => el.remove())
await stream.stopVideo()
await stream.stopAudio()
await client.leave()
await ZoomVideo.destroyClient()
// The renderer stays on this page, and the next session repeats this block.
Looking at the cleanup lifecycle: after destroyClient() runs, do you think doing a full reload is the safest route to guarantee all resources and singletons are fully wiped, or is there a preferred pattern you usually like to follow for post-destroy states?
Is vb_worker expected to boot on the WebRTC video path even when Virtual Background features are never requested?
Is there a public or supported API method to release these worker/worklet contexts during session teardown?
Is there an account or session flag to disable WebRTC video redirection if it isn’t required for our implementation?
Would enabling patchJsMedia: true allow a remote media-layer patch for this if one becomes available?
Thanks for the fix. I re-tested on Web Video SDK 2.6.0 with the same setup as my original post (leave() followed by ZoomVideo.destroyClient(), no page reload between sessions and same configurations).
vb_worker: fixed. It no longer appears after teardown.
“call” context: still left in memory after every session, about 20-22 MB per call. This isn’t reclaimed by idle time (waited for 30 mins post call have seen like 15-20% of reclaim) or forced GC, and it builds up fastest with short back-to-back calls.
Could you check:
Is the “call” residue a known issue, and is a fix planned?
Until then, is there a supported way to release it at session end, or is a page reload the recommended workaround?
Is the “call” residue a known issue, and is a fix planned?
In our sample app, we don’t have a “call” context, only “Main.” Across multiple tests, Main’s memory returns to its pre-join level after leaving the session.
Could you confirm whether your page runs inside an iframe? Also, is there any uncleaned DOM or potential memory leak that could cause memory growth?
The app doesn’t run inside an iframe. Also I have checked for other potential memory leaks / DOM clean up. I am certain about this, I’ll still double check and compare in again with the sample app observation. In the meantime can you think of anything else impacting this other than iframe ?
Thanks for checking. I compared again as promised, and I can now reproduce this outside our app.
1. About the “call” context
“call” is not a separate context. DevTools labels the page’s top-level context by its URL path, and ours happens to be /call. So “call” in my posts is the same thing as “Main” in yours. No iframe is involved.
2. Reproduction on a minimal page
To rule out our own code and DOM, I built a minimal standalone page: plain TypeScript, no framework, only the SDK calls from my first post, with startVideo({ hd: true, videoElement }). Each session ends with detachVideo → stopVideo → stopAudio → leave() → ZoomVideo.destroyClient(), and the page then removes that session’s DOM.
I ran 5 sessions back to back on one page load (SDK 2.6.0, Chrome 157, Windows 11) and took a heap snapshot before and after. DevTools forces a GC before each snapshot.
Object still alive
Before
After 5 sessions
RTCPeerConnection
1
6
AudioContext
1
6
AudioWorkletNode
3
13
Worker
3
14
MessagePort
3
13
MediaStreamTrack
28
163
JS heap of the page (after GC)
41.6 MB
78.2 MB
That is 1 RTCPeerConnection, 1 AudioContext, 2 AudioWorkletNodes and about 2 Workers kept per session. Our kiosk app (Chromium 140) shows the same per-session numbers, so this does not come from our app code or DOM.
3. What keeps them alive (retainer paths in the snapshot)
RTCPeerConnection: still referenced through avSyncMgr → pc → pc
AudioContext: held by an AudioWorkletNode that is still a pending activity, so the context does not seem to be closed
Worker: held in the localSharingDecMGR map, although we never start screen share
About 98% of the closures created during the 5 sessions and still alive belong to SDK scripts (the @zoom/videosdk bundle, js_media.min.js and the wmsc blob)
Questions
How was “Main’s memory returns to its pre-join level” measured in your sample app? Could you compare the object counts above in heap snapshots before and after 5 or more sessions on one page load?
Is there a supported way to release these at session end? If not, is a page reload the recommended workaround until a fix is available?
I can share the repro page source and the heap snapshots. The snapshots contain session data, so I would rather not post them publicly. What is the best private channel?