Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Memory leaks #24

Open
YorVeX opened this issue Oct 30, 2023 · 4 comments
Open

Memory leaks #24

YorVeX opened this issue Oct 30, 2023 · 4 comments

Comments

@YorVeX
Copy link

YorVeX commented Oct 30, 2023

Setup: obs-shaderfilter 2.1.1 with OBS 29.1.3 on Windows 10

Repro:

  • Run OBS and exit it again without obs-shaderfilter installed, check the OBS log -> no memory leaks
  • Install the obs-shaderfilter plugin
  • Add an empty media source (or any other source type a shader filter can be applied to), add a user-defined shader - for simplicity just pick the Add.shader from the examples folder, doesn't matter which one
  • Run OBS and exit it again, check the OBS log -> multiple memory leaks

How many depends on the number of shader filters configured, for my simple repro scenario with just one I can get as little as 4, in my real setup with lots of shaders configured (but not even activated) already a short start and stop of OBS currently reports 1199 memory leaks, I also saw more than 3000 in some runs.

@exeldro
Copy link
Owner

exeldro commented Oct 31, 2023

Thank you for the report. I just made memory leak fixes in master branch, that seems to fix all of them for my tests. Can you verify if that fixes all of them for you?
You should be able to get a build from: https://github.com/exeldro/obs-shaderfilter/actions/runs/6706036917

@YorVeX
Copy link
Author

YorVeX commented Oct 31, 2023

In my simple repro scenario above it went down from 4 to zero.

In my real setup the number of memory leaks went down from 1199 to 118, but that OBS instance is also using the obs-stroke-glow-shadow and obs-composite-blur plugins which according to the commit message also had memory leak fixes that you helped with. After I also installed the latest master branch builds for these two the memory leaks now went down to 25.

When I disabled the two other plugins for testing the number stayed at 25, so they seem to be fine now. When I disable obs-shaderfilter it goes down to 20, so apparently a few last leaks are still coming from this plugin. Will try to narrow it further down and report back here.

@YorVeX
Copy link
Author

YorVeX commented Oct 31, 2023

Boy, that was tedious. I got a lot of shaders and disabled them bit by bit, then restarted OBS twice to check the logs.

Since I recently reorganized stuff some of them didn't exist anymore in the path the shader filter configuration in OBS pointed to, and apparently that's what's causing memory leaks, at least one for each shader that points to a non-existing shader file.

For the repro scenario above simply rename Add.shader to something else after it was already configured, then start OBS, exit, and you get 1 memory leak.
image

The other memory leaks I still had were from the obs-shaderfilter-plus plugin, which I still use, because I still have lots of shaders that were specifically created for this plugin, and another one is coming from your 3D effect plugin (sorrrryyyyyyy 😝).

TBH about this last one from obs-shaderfilter I don't care too much, at least that memory leak is an indication that something is configured wrong and made me start looking and finding these cases. I'll leave it up to you to also fix that special case or just close this issue and ignore it. If you opt to fix it I will be happy to do another test for confirmation, I still kept my old scenes file with multiple shaders with wrong file configurations to test this with.

Repository owner deleted a comment from ahfauth Nov 1, 2023
@YorVeX
Copy link
Author

YorVeX commented Nov 3, 2023

Not sure whether 2.1.2 was supposed to also fix the memory leaks when the configured shader file is missing, so just to be on the safe side: they're still there with 2.1.2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants