obsproject / obs-studio

OBS Studio - Free and open source software for live streaming and screen recording
https://obsproject.com
GNU General Public License v2.0
60.68k stars 8.02k forks source link

Running 2 instances of OBS 28 creates memory leak #7722

Closed pandaXguy closed 2 years ago

pandaXguy commented 2 years ago

Operating System Info

Windows 11

Other OS

No response

OBS Studio Version

28.1.1

OBS Studio Version (Other)

No response

OBS Studio Log URL

https://obsproject.com/logs/hBkslOVA7rfpdV23

OBS Studio Crash Log URL

https://obsproject.com/logs/hBkslOVA7rfpdV23

Expected Behavior

When running 2 instances of OBS not having memory usage increase over time.

Current Behavior

When running 2 instances of OBS, even when not streaming memory usage increases by 1 percent every 3 to 4 minutes and will continue until memory usage is 100% and PC becomes unstable.

Steps to Reproduce

  1. Open task manager and view memory usage
  2. Open one instance of OBS 28.1.1
  3. Open a second instance of OBS 28.1.1.
  4. watch over time as memory usage ticks up by 1 until 100% ...

Anything else we should know?

There seems to be no other trigger other than having 2 instances open, tried with different scene collections and profile settings, once second session is closed the memory usage will start ticking down by 1 percent every few minutes.

Fenrirthviti commented 2 years ago

Please provide a full log from both sessions that contains the profiler information. This is written to the log when OBS is exited, so the easiest way to get this log is to launch both copies of OBS, wait for the issue to occur, and then exit both copies and grab the log files manually from the log folder.

pandaXguy commented 2 years ago

2022-11-05 11-14-40.txt 2022-11-05 11-51-28.txt

Hopefully this will help.

Fenrirthviti commented 2 years ago

Thanks, that's helpful. It looks like OBS is detecting memory leaks (5 in one log, 1 in the other), but I suspect those are probably coming from the third-party plugins rather than OBS itself.

Can you test again without any third-party plugins installed and see if it has the same issue? If it does, we can move forward with grabbing a memory dump of OBS while the issue is happening so we can look and see what's going on.

EDIT: Just as a note, I've been trying to reproduce any kind of leak on my end with a clean installation with no extra plugins, and I cannot.

pandaXguy commented 2 years ago

I recently did a fresh install of Windows and OBS, the only plug-in I installed was this one:

https://obsproject.com/forum/resources/spectralizer.861/

I have used it for a very long time, I will remove it and try without it, and upload new logs.

pandaXguy commented 2 years ago

Ok so I removed spectralizer, and ensured there is no other third party plugins, there was still a memory leak but it was much slower, before when opening 2 OBS Sessions memory would tick up 10 100% in about 3 hours, after removing I let it run overnight, it went from 35% to 98% in about 7 hours. attached are the logs from this last session.

2022-11-06 23-15-16.txt 2022-11-06 23-15-41.txt

RytoEX commented 2 years ago

Ok so I removed spectralizer, and ensured there is no other third party plugins

The logs show that you still have the StreamDeck plugin installed.

pandaXguy commented 2 years ago

Ok removed Streamdeck as well, this time the log files show memory leaks=0 but again from the time I opened up both instances of OBS my memory started ticking up 1% every few minutes and hit 100% in 4 and a half hours, after closing both instances, memory usage started ticking back down.

2022-11-08 09-53-20.txt 2022-11-08 09-53-31.txt

RytoEX commented 2 years ago

So while some plugins, including the Stream Deck plugin, are causing memory leaks of items we track, it seems there is still something leaking memory in your current setups. The best thing I can recommend to continue narrowing down the cause would be to remove one source at a time and repeat the test until you see a change in the behavior.

pandaXguy commented 2 years ago

I have been streaming for 5 years, using OBS with the same scenes and plugins etc, and this problem only exists in OBS 28, but your saying is OBS 28 is broken and you cannot fix it?

RytoEX commented 2 years ago

I'm saying that to narrow down the scope of what code we have to look at, it would be helpful to isolate exactly what is causing the behavior you're seeing on your system.

Fenrirthviti commented 2 years ago

Also to reiterate, I've been trying to replicate this on my system, and I am not able to. If we can't narrow down what's actually causing it, we can't investigate it further to fix. I understand that the testing might be tedious, but OBS is a very complex piece of software, so without more information on what is causing a problem, we're blinding looking for a needle in a haystack, but we haven't even found the door to the barn yet.

pandaXguy commented 2 years ago

I have created a blank profile and scene collection, for both instances and going to add things to it one at a time, I will let you know what I see.

pandaXguy commented 2 years ago

I am still testing, but I have several browser sources in each instance, and after removing them, and rebooting, it appears as if the problem stops, I am going to let this run a few more hours, and probably add some back just to be sure, but this is looking good as a possible source of the problem.

Fenrirthviti commented 2 years ago

Web content that has memory leaks is definitely something outside our control, or ability to fix. That would need to get fixed on the website/page itself. Going to go ahead and close this for now, but if you do reproduce without browser sources, just reply here and we can reopen and move on to more aggressive troubleshooting.