Turning Selfie Expression on and off repeatedly causes major VRAM and RAM leak.
tracked
lanes-
UPDATE: Please read the comments I've left below on this post to get more information and or updates!
UPDATE #2: Video attached -> https://www.youtube.com/watch?v=XsZ-ticOUUo
Launch VRChat.
Use a tool like RTSS to monitor frametime and VRAM usage.
Open the Tracking & IK settings.
Toggle Selfie Expression on and off repeatedly. (Make sure to wait for Selfie Expression to fully load in first, it takes a second or two every time it's turned back on.)
Observe RAM and VRAM usage gradually increase each time you toggle it, instead of returning to normal.
VRAM & RAM usage gets even worse if you do the following.
Reproduction steps:
- Set selfie expression quality to Best Quality (higher quality will make the memory increase more noticeable).
- Then enable Selfie Expression, wait until it loads in fully, then turn it off, then turn it on again repeatedly.
As you repeat this part, VRAM usage goes up by a moderate amount each time, but does not go down.
- When VRAM steadies or does not increase, Turn Selfie Expression off, then walk around for a minute or two or stay at the same screen.
- Change Selfie Expression to any quality, and then repeat step 2.
What I saw: VRAM usage will keep going up and up until maxed out, then will fallback to RAM but doing steps 2, 3 and 4 repeatedly enough will cause RAM to be maxed out alongside VRAM. Higher-resolution webcams result in much larger memory increases per toggle (each frame/buffer/texture is bigger), so VRAM fills far faster at 1080p/1440p/4K and using higher Selfie Expression quality amplifies this effect.
Workaround: Re-joining the instance, joining a different instance or restarting VRChat fixes it and usage returns to normal level.
Log In
This post was marked as
tracked
lanes-
Update on the issue and likely suspicions:
Before you read! These are only my observations and suspicions from testing. Nothing here is confirmed by VRChat devs.
After some more digging, it looks like the memory leak is tied to how Selfie Expression manages its camera and tracking pipeline.
Every toggle or quality change seems to re-initialize resources without fully releasing the old ones, which leads to VRAM and RAM steadily climbing.
The fact that the leak scales with webcam resolution suggests that large image buffers or textures may be left behind.
While I can’t confirm the exact implementation, systems like MediaPipe or similar landmark-tracking frameworks show this behavior if cleanup isn’t handled correctly, each restart of the pipeline allocates new GPU/CPU resources.
This would explain why restarting VRChat or rejoining an instance clears memory usage, and why the issue becomes more severe at higher resolutions.
Workarounds remain the same: rejoin, restart, or run at lower quality to slow the leak.
TL;DR: The memory leak likely comes from Selfie Expression re-initializing camera/tracking resources without fully releasing old ones. This causes VRAM/RAM usage to climb, especially at higher webcam resolutions.
lanes-
After doing some testing with my webcam, it appears that VRAM usage increases as webcam resolution increases alongside with RAM.
Reproduction steps:
- Open the Tracking & IK settings.
- Toggle Selfie Expression on and off repeatedly.
Observe RAM and VRAM usage gradually increase when repeating step 1 to 2, instead of returning to normal.
Webcam resolution:
1080p: Usage 3.5GB -> 4.1GB -> 4.5GB -> 4.85GB -> 5.1GB and increases so on when repeating step 1 to 2.
1440p: Usage: 3.5GB -> 4.1GB -> 4.7GB -> 5.3GB -> 5.9GB and increases so on when repeating step 1 to 2.
4k: Usage: 3.5GB -> 4.8GB -> 6.2GB -> 7.5GB -> 8.8GB -> 10.12GB -> 11.3GB -> VRAM maxed out -> Fallback to RAM -> RAM gets maxed out when repeating step 1 to 2 enough.
Higher quality and that combined with webcam resolution will eat more VRAM and RAM. Even lower quality still take a decent hit at RAM and VRAM.