# Plex for Windows progressively using more and more video memory

**URL:** https://forums.plex.tv/t/plex-for-windows-progressively-using-more-and-more-video-memory/801475
**Category:** Plex Players
**Tags:** player-windows
**Created:** [July 20, 2022, 10:39pm UTC](https://forums.plex.tv/t/plex-for-windows-progressively-using-more-and-more-video-memory/801475 "2022-07-20T22:39:46Z")
**Posts on this page:** 17
**Page:** 1

<div class="post-metadata">

### Author: ![Wieku](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/wieku/32/282221_2.png) [@Wieku](https://forums.plex.tv/u/Wieku)
#### Post date: [July 20, 2022, 10:39pm UTC](https://forums.plex.tv/t/plex-for-windows-progressively-using-more-and-more-video-memory/801475/1 "2022-07-20T22:39:46Z")

</div>

Server Version#: unknown  
Player Version#: 1.48.2.3124-647ff031

I haven’t tested the newest version yet but I haven’t noticed any announcements relating to this issue.

I often use videos playing on Plex as a background. Since like 3 months ago I noticed that Plex after playing for couple hours starts using substantial amounts of VRAM.

![plexbug](https://global.discourse-cdn.com/plex/original/4X/0/0/a/00aa1e9407d65d66a6fb7914cb610e3cf914e9d4.gif)

Today it was using a bit over 3GB before closing.  
I looked at logs and found nothing that could be of use.

OS: Windows 10 Version 2009 [10.0.19043] x86\_64  
GPU: NVIDIA GTX 1080  
GPU Drivers: 516.59  
Hardware Decoding at Normal Quality, Rate Switching disabled

---

<div class="post-metadata">

### Author: ![Mitzsch](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/mitzsch/32/308163_2.png) [@Mitzsch](https://forums.plex.tv/u/Mitzsch)
#### Post date: [July 21, 2022, 6:41am UTC](https://forums.plex.tv/t/plex-for-windows-progressively-using-more-and-more-video-memory/801475/2 "2022-07-21T06:41:57Z")

</div>

This was also present in Plex HTPC but has been fixed there. I thought it was also fixed in the Desktop Player.  
Are you running the latest version? (The video shown above shows version 1.44)

> <https://github.com/mpv-player/mpv/pull/10191>
>
> A VRAM memory leak was present in d3d11 when \`idle=yes\` and playback stops for a…n item. This patch re-enables some of the code which is only used during diagnostic which fixes the issue.
> 
> I had previously mentioned this and the fix in the #mpv IRC channel. This resolves the leak in our testing so we are upstreaming it.

---

<div class="post-metadata">

### Author: ![gbooker02](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/gbooker02/32/9726_2.png) [@gbooker02](https://forums.plex.tv/u/gbooker02)
#### Post date: [July 21, 2022, 1:20pm UTC](https://forums.plex.tv/t/plex-for-windows-progressively-using-more-and-more-video-memory/801475/3 "2022-07-21T13:20:29Z")

</div>

> [@Wieku](#):
>
> Player Version#: 1.48.2.3124-647ff031

That’s not what your screen recording shows; it shows a considerably older version. We fixed this in the MPV that we ship (both in HTPC and Plex for Windows) a couple of months ago so you should update your version.

---

<div class="post-metadata">

### Author: ![Wieku](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/wieku/32/282221_2.png) [@Wieku](https://forums.plex.tv/u/Wieku)
#### Post date: [July 22, 2022, 1:32pm UTC](https://forums.plex.tv/t/plex-for-windows-progressively-using-more-and-more-video-memory/801475/4 "2022-07-22T13:32:05Z")

</div>

Correct. Although:

> Today it was using a bit over 3GB before closing.

That line was on 1.48.2.3124-647ff031. The video showed the biggest leak I experienced.

Today I made a test on 1.49.1.3146-73559c78:  
 ![2022-07-22_15-17-16_Wx1eM](https://global.discourse-cdn.com/plex/original/4X/d/8/3/d8359ecb607e855104a3836cbc666bc4696273ef.gif)

The test consisted of playing 8 Full HD 25 minute episodes (closing after like 10 seconds of watching) and then watching a 4k movie for 5 minutes. At a peak it was using close to 4GB of VRAM before closing the movie.

Also worth to mention is that with the same 4k content, Plex on Edge browser uses around 500MB of VRAM (with hardware decoding) meanwhile Plex for Windows is using around 1.2GB.

---

<div class="post-metadata">

### Author: ![Mitzsch](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/mitzsch/32/308163_2.png) [@Mitzsch](https://forums.plex.tv/u/Mitzsch)
#### Post date: [July 22, 2022, 1:42pm UTC](https://forums.plex.tv/t/plex-for-windows-progressively-using-more-and-more-video-memory/801475/5 "2022-07-22T13:42:40Z")

</div>

This is weird. Can you try that same test with a different mpv lib to see if it also affects the upstream version of mpv?

[https://forums.plex.tv/t/htpc-tips-and-tricks/794228/2](https://forums.plex.tv/t/htpc-tips-and-tricks/794228/2)  
(also applicable for Plex for Desktop)

---

<div class="post-metadata">

### Author: ![Wieku](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/wieku/32/282221_2.png) [@Wieku](https://forums.plex.tv/u/Wieku)
#### Post date: [July 22, 2022, 3:06pm UTC](https://forums.plex.tv/t/plex-for-windows-progressively-using-more-and-more-video-memory/801475/6 "2022-07-22T15:06:22Z")

</div>

Do you want me to test a specific version of mpv library?

I tried `mpv-dev-x86_64-20220717-git-70fa950` using instructions in the thread you provided and the issue is still there.

Out of curiosity I tried Plex HTPC as well and results are the same.

Also I downloaded the media I used to test with to my computer and played them in playlist mode with `mpv-x86_64-20220717-git-70fa950` with `--hwdec=auto`. With 4k movie VRAM usage jumped to 500MB (less than 1.2GB through Plex) but after switching to episodes it dropped to 110MB and held steady even with 20 episode switches (on Plex it was raising by 150-300MB per episode). Don’t know if that info would be of any use, though.

---

<div class="post-metadata">

### Author: ![Mitzsch](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/mitzsch/32/308163_2.png) [@Mitzsch](https://forums.plex.tv/u/Mitzsch)
#### Post date: [July 22, 2022, 3:22pm UTC](https://forums.plex.tv/t/plex-for-windows-progressively-using-more-and-more-video-memory/801475/7 "2022-07-22T15:22:53Z")

</div>

My bad, I should have linked to the newest build. The fix provided by @gbooker02 was just merged yesterday into the mpv upstream repo and the build provided via SourceForge isn’t updated yet.  
Please try this build [Release 20220722 · shinchiro/mpv-winbuild-cmake · GitHub](https://github.com/shinchiro/mpv-winbuild-cmake/releases/tag/20220722). (#update: it should include it - it has the commit hash “git-9931538” in the mpv archive name.) If the issue is still there then, it’s a new one. I will also try this on my setup when I got some spare time in about 1 week.

---

<div class="post-metadata">

### Author: ![Wieku](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/wieku/32/282221_2.png) [@Wieku](https://forums.plex.tv/u/Wieku)
#### Post date: [July 22, 2022, 4:15pm UTC](https://forums.plex.tv/t/plex-for-windows-progressively-using-more-and-more-video-memory/801475/8 "2022-07-22T16:15:49Z")

</div>

Thanks. Unfortunately the issue is still there 😕

---

<div class="post-metadata">

### Author: ![Mitzsch](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/mitzsch/32/308163_2.png) [@Mitzsch](https://forums.plex.tv/u/Mitzsch)
#### Post date: [July 26, 2022, 8:47am UTC](https://forums.plex.tv/t/plex-for-windows-progressively-using-more-and-more-video-memory/801475/9 "2022-07-26T08:47:23Z")

</div>

Well, this is strange. So you see this behavior only in Plex for Windows (no matter what version) but not in Plex HTPC?

Have you tried removing Plex for Windows (+ manually removing the Folder under the Appdata dir and the leftover parts in ProgramFiles) and reinstalling it?

---

<div class="post-metadata">

### Author: ![Wieku](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/wieku/32/282221_2.png) [@Wieku](https://forums.plex.tv/u/Wieku)
#### Post date: [July 26, 2022, 11:49am UTC](https://forums.plex.tv/t/plex-for-windows-progressively-using-more-and-more-video-memory/801475/10 "2022-07-26T11:49:57Z")

</div>

Oh sorry if that was misleading. I have the same issue on freshly installed Plex HTPC.

---

<div class="post-metadata">

### Author: ![gbooker02](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/gbooker02/32/9726_2.png) [@gbooker02](https://forums.plex.tv/u/gbooker02)
#### Post date: [July 26, 2022, 2:58pm UTC](https://forums.plex.tv/t/plex-for-windows-progressively-using-more-and-more-video-memory/801475/11 "2022-07-26T14:58:47Z")

</div>

> [@Wieku](#):
>
> Also I downloaded the media I used to test with to my computer and played them in playlist mode

Presuming that you are talking about standalone MPV, this isn’t testing the same codepaths. To actually test it properly you need to use `--idle=yes` with no other options. Then use the console (hit the backtick key) and type `loadfile filename`. Play/skip to the end. Hit backtick again and hit the up-arrow/return to execute the command again. Repeat. Monitor the VRAM usage during this time. Try with and without hardware decoding and if you are adventurous with other gpu contexts (such as `winvk`).

> [@Wieku](#):
>
> With 4k movie VRAM usage jumped to 500MB (less than 1.2GB through Plex)

The difference in memory usage is almost certainly due to the fact that you aren’t running MPV with the same options. These options can create different memory usage through the swapchain. Your Plex for Windows logs does indicate what options it gives to MPV.

---

<div class="post-metadata">

### Author: ![Wieku](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/wieku/32/282221_2.png) [@Wieku](https://forums.plex.tv/u/Wieku)
#### Post date: [July 26, 2022, 4:35pm UTC](https://forums.plex.tv/t/plex-for-windows-progressively-using-more-and-more-video-memory/801475/12 "2022-07-26T16:35:53Z")

</div>

I tried running `mpv-x86_64-20220717-git-70fa950`, the same version I used with playlist mode. This time I used the mpv console.

With:

```auto
idle=yes
hwdec=dxva2
gpu-context=d3d11
vo=gpu

```

VRAM usage by mpv was always dropping to 27-30MB after playback end (window stayed open).

With this, however (options I got from verbose logs):

```auto
idle=yes
hwdec=auto
vo=gpu
gpu-context=d3d11
cscale=spline36
cscale-antiring=0
deband=no
deband-iterations=1
deband-threshold=32
dither-depth=no
dscale=spline36
dscale-antiring=0
linear-downscaling=no
scale=spline36
scale-antiring=0
sigmoid-upscaling=no

```

VRAM was staying at ~150MB after playback end, but on loading the next file memory seemed to be cleaned before starting the playback (4k movie was always using ~660MB, episode ~170MB).

Another thing I noticed is that scaling the standalone mpv window does not change VRAM usage, scaling the Plex window results in 300-500MB difference in VRAM usage (WQHD screen).

---

<div class="post-metadata">

### Author: ![gbooker02](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/gbooker02/32/9726_2.png) [@gbooker02](https://forums.plex.tv/u/gbooker02)
#### Post date: [July 26, 2022, 6:19pm UTC](https://forums.plex.tv/t/plex-for-windows-progressively-using-more-and-more-video-memory/801475/13 "2022-07-26T18:19:19Z")

</div>

> [@Wieku](#):
>
> With:
> 
> ```auto
> …
> hwdec=dxva2
> 
> ```

Is there a reason you are using `dxva2`? I expect that if you are using `auto` it will end up using `d3d11`. You can see what it does by adding the option `msg-level=all=v`.

> [@Wieku](#):
>
> With this, however (options I got from verbose logs):

There are also some options set when the app starts up though `gpu-hwdec-interop=auto` may be the only important one.

> [@Wieku](#):
>
> VRAM was staying at ~150MB after playback end, but on loading the next file memory seemed to be cleaned before starting the playback.

This is normal in that it holds some memory until the next playback starts. The difference in memory appears to be proportional to the decoded picture size. A file that’s in SD is difficult to notice in memory usage.

> [@Wieku](#):
>
> Another thing I noticed is that scaling the standalone mpv window does not change VRAM usage, scaling the Plex window results in 300-500MB difference in VRAM usage (WQHD screen).

This is odd. Perhaps something in the embedding code in MPV is causing this but I’m starting to question drivers. It may be worth:

- Changing the video quality setting in Plex for Windows/HTPC to one of the `ANGLE` ones to see if that makes a difference.
- Turn off hardware decoding to see if it makes a difference

---

<div class="post-metadata">

### Author: ![Wieku](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/wieku/32/282221_2.png) [@Wieku](https://forums.plex.tv/u/Wieku)
#### Post date: [July 26, 2022, 9:08pm UTC](https://forums.plex.tv/t/plex-for-windows-progressively-using-more-and-more-video-memory/801475/14 "2022-07-26T21:08:54Z")

</div>

> [@gbooker02](#):
>
> Is there a reason you are using `dxva2`? I expect that if you are using `auto` it will end up using `d3d11`. You can see what it does by adding the option `msg-level=all=v`.

On auto it uses d3d11va, I thought dxva2 is the one. My bad.  
Second test used auto, though.

> [@gbooker02](#):
>
> This is odd. Perhaps something in the embedding code in MPV is causing this but I’m starting to question drivers. It may be worth:
> 
> - Changing the video quality setting in Plex for Windows/HTPC to one of the `ANGLE` ones to see if that makes a difference.
> - Turn off hardware decoding to see if it makes a difference

Now it’s interesting. With hardware decoding off, I get the leak only on ANGLE renderer (200MB per full hd episode). With hardware decoding on, I get the leak on both renderers. Tested mpv with `--idle=yes --hwdec=no --gpu-context=angle` (confirmed with logs that it uses GLES) and there’s no leak.

About resizing:  
With both renderers and hardware decoding off I still get that 300MB VRAM increase when maximizing. I forgot to mention that resizing one is not a leak, VRAM reduces by that 300MB when unmaximizing, it’s still quite a chunk IMO.

---

<div class="post-metadata">

### Author: ![gbooker02](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/gbooker02/32/9726_2.png) [@gbooker02](https://forums.plex.tv/u/gbooker02)
#### Post date: [July 27, 2022, 5:39pm UTC](https://forums.plex.tv/t/plex-for-windows-progressively-using-more-and-more-video-memory/801475/15 "2022-07-27T17:39:39Z")

</div>

I’m not sure what else to try here or what the resolution might be in your case. I am not seeing the leaks you see nor has anyone else reported it that I’ve seen. This really seems to be something that’s exclusive to something in your system. The only leak we’ve ever seen was the one linked in the second comment which has since been fixed.

---

<div class="post-metadata">

### Author: ![Mitzsch](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/mitzsch/32/308163_2.png) [@Mitzsch](https://forums.plex.tv/u/Mitzsch)
#### Post date: [July 29, 2022, 5:46pm UTC](https://forums.plex.tv/t/plex-for-windows-progressively-using-more-and-more-video-memory/801475/16 "2022-07-29T17:46:00Z")

</div>

I tried it on my end and I also have this issue but **not** with an out-of-the-box install. On my end it seems to be vo=gpu-next + d3d11 related. vo=gpu with d3d11 is working as it should, with the shipped or with a different dll. Note this is not visible with Vulkan.

This time it is also different. When playing back a file, more VRAM is used, after that, it is flushed except for a small amount (in my case 150mb with each file) - do this 7 times and 1 additional Gig of VRAM is used… The mpv lib I used for testing includes the patch linked in this thread\*

---

<div class="post-metadata">

### Author: ![system](https://global.discourse-cdn.com/plex/original/3X/2/a/2acb9765406f63293d357b4ec509ec39aa28f2ad.png) [@system](https://forums.plex.tv/u/system)
#### Post date: [October 27, 2022, 5:46pm UTC](https://forums.plex.tv/t/plex-for-windows-progressively-using-more-and-more-video-memory/801475/17 "2022-10-27T17:46:46Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
