Question / Help OBS running out of application memory, after 2 years of no problems?

Sgt_Rek

New Member
macOS Sierra
Version 10.12.6
iMac 27" Mid 2011
3.4 GHz Intel Core i7
16 GB 1333 MHz DDR3
AMD Radeon HD 6970M 1024 MB


Been streaming on Twitch with OBS the past 2 years with almost no problems whatsoever until the past week or so. Normally while streaming I have the following apps open:
- OBS
- ClipstudioPaint
- Discord
- Telegram
- Brave Browser
- Clementine (music app)

But now after streaming for a while (anywhere from 1-3 hours, it doesn't seem to be consistent) OBS will freeze up and a window saying "Your system has run out of application memory - To avoid problems with your computer, quit any applications you are not using" will pop up, showing OBS as "(paused)", sometimes 1 or 2 other apps like my browser or ClipStudioPaint being paused too, but always OBS first.

Here's an example from Google (not my screencap obviously, but just to give you an idea)

1577438707364.png


I end up having to scramble around closing app windows to continue my streams, but the problem comes back even after closing everything BUT OBS and ClipStudio, requiring me to just restart OBS altogether and hope I can continue my stream.

Log File #1 - https://obsproject.com/logs/BsGb5_lcsYaAcJD8

After Log #1 took place, I restarted OBS and changed my Output Mode from Advanced to Simple and dropped my bitrate to 780 kbps to see if that'd help, then resumed broadcasting in Log #2 below:

Log File #2 - https://obsproject.com/logs/TpQ9lKyalnvbA7kC

Things went fine for about another hour until the problem came back up again. I just closed all my browser windows and some of the extra ClipStudio documents I had open, which was never a problem until now.

When this happens and I go into the Activity Monitor and check the Memory usage everything looks green and normal. I don't have any more windows open than I did before, and I haven't made any big changes to my system recently aside from getting a new webcam for my video-capture device (Logitec c920s). I've got about 836 GB free space on a 2TB SSHD so it can't be that either.

Anyways this is incredibly frustrating, I've had such good luck with OBS up until now!
 

Sgt_Rek

New Member
EDIT: I spoke too soon. The memory problem just came back around the 2:55hrs streaming mark. Will post a log and details soon.

---------

Thanks Narcogen. Looks like those error messages are from the Discord Streamkit overlay thing. I removed that from the Sources and am running a Test Stream through Twitch right now. So far those error messages aren't appearing in the current log, and I haven't seen the system memory problem come back (as of 2.5hrs of test-streaming that is).

I'll probably try a regular broadcast tomorrow or Sunday night and report back with my results.

Unfortunately this does mean StreamKit's Discord widget might now be unusable for me. Anyone have recommendations for an alternative? Just need a widget that displays Discord voice chatter icons/names when they talk in the stream.
 
Last edited:

Sgt_Rek

New Member
So yeah the problem is still here:

Newest log file. You'll notice a string of errors in the log until I disabled the Discord Overlay, and the stream continued on for a good hour or 2 with no problems.
https://obsproject.com/logs/jxXtNn9BieI1tg83

Here's what my Activity Monitor looks like when I start running OBS
Screen Shot 2019-12-27 at 7.41.19 PM.png



Then towards the 2:55hr mark, the original problem re-appeared:
Screen Shot 2019-12-27 at 7.18.38 PM.png


I close some app windows so I can function enough to look at the Activity Monitor. Wtf, look at OBS's memory usage now
Screen Shot 2019-12-27 at 7.23.16 PM.png


I restarted OBS and this time kept an eye on the Activity Monitor for about 15 minutes. The Memory field was slowly but surely ticking upwards, starting at around 1.5 gb and then at 5gb about 15-20 minutes later, and I assume is just piling up until that error message kicks in.

So I guess it wasn't the Discord Overlay, I wonder what now?
 

Attachments

  • Screen Shot 2019-12-27 at 7.30.22 PM.png
    Screen Shot 2019-12-27 at 7.30.22 PM.png
    118.2 KB · Views: 32

Sgt_Rek

New Member
Did the out of memory error coincide with the network error, or did it precede it?

If by 'network error' you mean the StreamKit Discord Overlay error in the logfile, I think it preceded it, since it appears in the log file long before the memory crash occurs. I started that last stream with the Overlay enabled, but then removed it while the stream was already going. Removing it mid-stream didn't seem to stop the problem from occurring later though.

Anyways I ran another test-stream today, this time with the StreamKit Discord Overlay totally removed from all OBS scenes before I started the stream. Ran it for almost 7hrs and the memory issue didn't appear. Memory usage in the Activity Monitor stayed at normal levels. Here's the logfile: https://obsproject.com/logs/DUuV6QsnD8LXIATP

So maybe there is something wrong with the Discord Overlay that's causing a memory leak? This is the link to the overlay app. If anyone knows of alternatives I could use, that would help a lot: https://streamkit.discordapp.com/overlay
 
Last edited:

Narcogen

Active Member
Nope, I mean this network issue:

19:20:20.758: WriteN, RTMP send error 32 (4097 bytes)
19:20:20.759: WriteN, RTMP send error 32 (99 bytes)
19:20:20.759: WriteN, RTMP send error 9 (42 bytes)
19:20:20.759: [rtmp stream: 'simple_stream'] Disconnected from rtmp://live-ord02.twitch.tv/app


and this one

19:20:20.759: Output 'simple_stream': Number of dropped frames due to insufficient bandwidth/connection stalls: 15154 (5.7%)

and this one

19:20:30.937: [rtmp stream: 'simple_stream'] Connecting to RTMP URL rtmp://live-ord02.twitch.tv/app...
19:20:31.998: [rtmp stream: 'simple_stream'] Connection to rtmp://live-ord02.twitch.tv/app successful
19:29:15.998: WriteN, RTMP send error 32 (1137 bytes)
19:29:16.000: WriteN, RTMP send error 32 (99 bytes)
19:29:16.000: WriteN, RTMP send error 9 (42 bytes)
19:29:16.000: [rtmp stream: 'simple_stream'] Disconnected from rtmp://live-ord02.twitch.tv/app

19:29:16.000: Output 'simple_stream': Number of dropped frames due to insufficient bandwidth/connection stalls: 641 (5.4%)



If removing the Discord overlay solved it, then I tend to think that's the issue. It's possibly increasing its memory footprint with each failed attempt to load resources it can't find.
 

Sgt_Rek

New Member
Alright so I removed the Discord overlay and things were working fine for a while, but the memory leak issue has reappeared and starts making my livestreaming unbearable after a few hours. I'm utterly stumped.

Log File: https://obsproject.com/logs/oUIpgKV9TBL3GqzM

Notice at the end of the logfile "22:40:16.302: Number of memory leaks: 1"

Screencap of Activity Monitor at the start of the stream:
Screen Shot 2020-01-16 at 10.41.39 PM.png


And near the end when I had to restart OBS because the RAM usage was chugging everything to a crawl.
Screen Shot 2020-01-16 at 10.38.34 PM.png
 

Narcogen

Active Member
I've also got OBS reporting "1 memory leak" and I've never seen OBS leak anywhere near this much. It's not normal.

In addition to any 3rd party plugins or overlays like Discord, I'd suggest removing any broken/corrupt images mentioned in the logfile:

17:14:48.812: init_animated_gif: Failed to open file '/Users/jchew/Documents/DESKTOP STUFF TO SORT/Temp Images/straydog2.gif'
17:14:48.812: [image_source: 'gif7'] failed to load texture '/Users/jchew/Documents/DESKTOP STUFF TO SORT/Temp Images/straydog2.gif'
17:14:48.813: init_animated_gif: Failed to open file '/Users/jchew/Documents/DESKTOP STUFF TO SORT/Temp Images/aeon.gif'
17:14:48.813: [image_source: 'gif4'] failed to load texture '/Users/jchew/Documents/DESKTOP STUFF TO SORT/Temp Images/aeon.gif'
17:14:48.823: init_animated_gif: Failed to open file '/Users/jchew/Documents/DESKTOP STUFF TO SORT/Temp Images/worldpeacechopper.gif'
17:14:48.823: [image_source: 'chopper'] failed to load texture '/Users/jchew/Documents/DESKTOP STUFF TO SORT/Temp Images/worldpeacechopper.gif'
17:14:48.823: init_animated_gif: Failed to open file '/Users/jchew/Documents/DESKTOP STUFF TO SORT/Temp Images/justice.gif'
17:14:48.823: [image_source: 'gif2'] failed to load texture '/Users/jchew/Documents/DESKTOP STUFF TO SORT/Temp Images/justice.gif'

17:14:49.187: init_animated_gif: Failed to open file '/Users/jchew/Documents/DESKTOP STUFF TO SORT/Temp Images/gunhed1.gif'
17:14:49.187: [image_source: 'gif6'] failed to load texture '/Users/jchew/Documents/DESKTOP STUFF TO SORT/Temp Images/gunhed1.gif'


I don't see any log errors associated with, but in the spirit of trying to eliminate any possible sources, it might be useful to remove this media source:

17:14:49.512: [Media Source 'EAT VID']: settings:
17:14:49.512: input: /Users/jchew/Downloads/strawberry-tapir.mp4
17:14:49.512: input_format: (null)
17:14:49.512: speed: 100
17:14:49.512: is_looping: yes
17:14:49.512: is_hw_decoding: no
17:14:49.512: is_clear_on_media_end: yes
17:14:49.512: restart_on_activate: yes
17:14:49.512: close_when_inactive: yes


Alternatively you could start over with a fresh, blank profile and scene collection for testing purposes, see if the issue repeats, and if not, add back your usual sources, scenes and filters until you see the one that causes the leak.
 

Sgt_Rek

New Member
I've also got OBS reporting "1 memory leak" and I've never seen OBS leak anywhere near this much. It's not normal.

In addition to any 3rd party plugins or overlays like Discord, I'd suggest removing any broken/corrupt images mentioned in the logfile:

17:14:48.812: init_animated_gif: Failed to open file '/Users/jchew/Documents/DESKTOP STUFF TO SORT/Temp Images/straydog2.gif'
17:14:48.812: [image_source: 'gif7'] failed to load texture '/Users/jchew/Documents/DESKTOP STUFF TO SORT/Temp Images/straydog2.gif'
17:14:48.813: init_animated_gif: Failed to open file '/Users/jchew/Documents/DESKTOP STUFF TO SORT/Temp Images/aeon.gif'
17:14:48.813: [image_source: 'gif4'] failed to load texture '/Users/jchew/Documents/DESKTOP STUFF TO SORT/Temp Images/aeon.gif'
17:14:48.823: init_animated_gif: Failed to open file '/Users/jchew/Documents/DESKTOP STUFF TO SORT/Temp Images/worldpeacechopper.gif'
17:14:48.823: [image_source: 'chopper'] failed to load texture '/Users/jchew/Documents/DESKTOP STUFF TO SORT/Temp Images/worldpeacechopper.gif'
17:14:48.823: init_animated_gif: Failed to open file '/Users/jchew/Documents/DESKTOP STUFF TO SORT/Temp Images/justice.gif'
17:14:48.823: [image_source: 'gif2'] failed to load texture '/Users/jchew/Documents/DESKTOP STUFF TO SORT/Temp Images/justice.gif'

17:14:49.187: init_animated_gif: Failed to open file '/Users/jchew/Documents/DESKTOP STUFF TO SORT/Temp Images/gunhed1.gif'
17:14:49.187: [image_source: 'gif6'] failed to load texture '/Users/jchew/Documents/DESKTOP STUFF TO SORT/Temp Images/gunhed1.gif'


I don't see any log errors associated with, but in the spirit of trying to eliminate any possible sources, it might be useful to remove this media source:

17:14:49.512: [Media Source 'EAT VID']: settings:
17:14:49.512: input: /Users/jchew/Downloads/strawberry-tapir.mp4
17:14:49.512: input_format: (null)
17:14:49.512: speed: 100
17:14:49.512: is_looping: yes
17:14:49.512: is_hw_decoding: no
17:14:49.512: is_clear_on_media_end: yes
17:14:49.512: restart_on_activate: yes
17:14:49.512: close_when_inactive: yes


Alternatively you could start over with a fresh, blank profile and scene collection for testing purposes, see if the issue repeats, and if not, add back your usual sources, scenes and filters until you see the one that causes the leak.
I've also got OBS reporting "1 memory leak" and I've never seen OBS leak anywhere near this much. It's not normal.

In addition to any 3rd party plugins or overlays like Discord, I'd suggest removing any broken/corrupt images mentioned in the logfile:

17:14:48.812: init_animated_gif: Failed to open file '/Users/jchew/Documents/DESKTOP STUFF TO SORT/Temp Images/straydog2.gif'
17:14:48.812: [image_source: 'gif7'] failed to load texture '/Users/jchew/Documents/DESKTOP STUFF TO SORT/Temp Images/straydog2.gif'
17:14:48.813: init_animated_gif: Failed to open file '/Users/jchew/Documents/DESKTOP STUFF TO SORT/Temp Images/aeon.gif'
17:14:48.813: [image_source: 'gif4'] failed to load texture '/Users/jchew/Documents/DESKTOP STUFF TO SORT/Temp Images/aeon.gif'
17:14:48.823: init_animated_gif: Failed to open file '/Users/jchew/Documents/DESKTOP STUFF TO SORT/Temp Images/worldpeacechopper.gif'
17:14:48.823: [image_source: 'chopper'] failed to load texture '/Users/jchew/Documents/DESKTOP STUFF TO SORT/Temp Images/worldpeacechopper.gif'
17:14:48.823: init_animated_gif: Failed to open file '/Users/jchew/Documents/DESKTOP STUFF TO SORT/Temp Images/justice.gif'
17:14:48.823: [image_source: 'gif2'] failed to load texture '/Users/jchew/Documents/DESKTOP STUFF TO SORT/Temp Images/justice.gif'

17:14:49.187: init_animated_gif: Failed to open file '/Users/jchew/Documents/DESKTOP STUFF TO SORT/Temp Images/gunhed1.gif'
17:14:49.187: [image_source: 'gif6'] failed to load texture '/Users/jchew/Documents/DESKTOP STUFF TO SORT/Temp Images/gunhed1.gif'


I don't see any log errors associated with, but in the spirit of trying to eliminate any possible sources, it might be useful to remove this media source:

17:14:49.512: [Media Source 'EAT VID']: settings:
17:14:49.512: input: /Users/jchew/Downloads/strawberry-tapir.mp4
17:14:49.512: input_format: (null)
17:14:49.512: speed: 100
17:14:49.512: is_looping: yes
17:14:49.512: is_hw_decoding: no
17:14:49.512: is_clear_on_media_end: yes
17:14:49.512: restart_on_activate: yes
17:14:49.512: close_when_inactive: yes


Alternatively you could start over with a fresh, blank profile and scene collection for testing purposes, see if the issue repeats, and if not, add back your usual sources, scenes and filters until you see the one that causes the leak.

I'll give this a try and delete all those broken image links, see how the next livestream goes. I've got company over for the next few days but Thursday I should be able to get in a long enough stream session to see if this works. Will report back afterwards
 

Sgt_Rek

New Member
I'll give this a try and delete all those broken image links, see how the next livestream goes. I've got company over for the next few days but Thursday I should be able to get in a long enough stream session to see if this works. Will report back afterwards
I'll give this a try and delete all those broken image links, see how the next livestream goes. I've got company over for the next few days but Thursday I should be able to get in a long enough stream session to see if this works. Will report back afterwards

Alright so I deleted those media Sources that were popping up in the errors or broken links. Last night I did a nice 9 hour stream with no issues. Hopefully I'm not jinxing anything here, but maybe those broken gif/video sources were the issue even though they were set to invisible?

Anyways I'll keep streaming and monitoring the situation, maybe slowly add 1 widget at a time to see if I can confirm where the true culprit was. If I run into the problem again or have info that might help others I'll be sure to reply here.

Also here's the logfile: https://obsproject.com/logs/xgy4xVpgzRB_sYUi
 

Narcogen

Active Member
Media sources still get loaded even if they are not visible, since they have to be ready to go in an instant if you should make them visible-- the program can't wait until you set them visible to load into memory.

Images that fail to load at start up will get repeated attempts to load, at least every time you switch scenes, so yes, it is entirely possible that broken, dead, or problematic media sources to impact performance even if they are not visible.
 

Sgt_Rek

New Member
Uggghhh, alright folks the problem is back yet again. Stream runs fine up until around 2-3 hours in, when OBS starts devouring RAM and forces applications to stall. Here's the logfiles from last night:

First part (This ended a couple hours in due to the memory leak crashing OBS abruptly): https://obsproject.com/logs/fvq5E58E_8qtjUX7
Second part. No crash, but the memory leak was increasing in size towards the end nonetheless and causing everything to lag: https://obsproject.com/logs/l-iuD55f_ylPqAvf

This is seriously frustrating as hell. What's weird is that it doesn't seem to happen every single time, I just can't figure out what triggers it.

Screen Shot 2020-02-11 at 11.42.14 PM.png
 

Narcogen

Active Member
1st logfile ends when streaming starts. I'm guessing the crash ended the session, but it means unfortunately there's no info in the log about that session.

2nd logfile shows what appears to be a pretty normal and eventful streaming session-- unfortunately I don't see anything in the log that indicates a problem.

I'm also somewhat confused by your activity monitor shots-- it seems to suggest OBS is using 41Gb of RAM on a machine that only has 16Gb of physical memory, which should mean a lot of stuff being paged... but the memory pressure graph doesn't indicate that at all, showing only 4gb of swap used.

Like... right now, with just a browser and a few apps open and no OBS, my Mac Pro running Mojave is has about 12Gb of memory used, 7 Gb in app memory.

I am... puzzled.

If you make a new user on that machine, and run OBS that long with a minimal scene setup, does it also happen?

How many images are in your slideshow source?

Does anything change if you remove your scenecut=0 custom x264 setting?
 

Sgt_Rek

New Member
If you make a new user on that machine, and run OBS that long with a minimal scene setup, does it also happen?

How many images are in your slideshow source?

Does anything change if you remove your scenecut=0 custom x264 setting?

I went into my Settings and Output Mode just now, switched from Advanced to Simple. We'll see if that works I guess. I'll be doing a livestream today so I'll report back with my results from that.

Haven't tried making a new user and running OBS under it though. Not sure how that might help but I'll keep that idea in the back of my head if all other things fail.

I've only got about 10 images in the slideshow.
 

Narcogen

Active Member
Ok, so the slideshow is not an issue.

The new user test is just a way of isolating where the problem might be. If a new user, with blank/empty profiles and scene collection still experience the issue, then it's something fundamental to OBS on the OS version or something external to your system (peripheral or driver).

If the effect goes away, then you can start adding back elements of your usual setup one by one and testing, and seeing where the problem recurs to isolate if there's any one part of your setup (source, scene, filter, or other) that is in particular the cause.
 

Sgt_Rek

New Member
Okay I THINK I may have isolated the problem? The annoying thing is that it's a widget I kind of need.

I reinstalled an older version of OBS (24.0.2) and was running a test stream last night and noticed I wasn't getting any memory leaks. Mysterious right? I then decided to test out some of my Streamlabs Alerts and noticed that with each alert I triggered into the OBS widget, the app's memory usage would bump up a little bit with each alert.

This would explain why during test streams where I'm getting no alerts everything seems fine, but as soon as I do a livestream where there's a lot of people following me, sending bits and subscriptions etc, the app's memory use increases.

So now then... How do I fix this while still being able to use my Alertbox? I've been fiddling around with the settings there, like Shutdown Source when Not Visible and Refresh Browser Cashe When Scene Becomes Active, but can't seem to get it to stop eating memory every time it's triggered.

Screen Shot 2020-02-17 at 2.41.33 PM.png
 

Sgt_Rek

New Member
Also, quick addendum:

I noticed I CAN clear out the memory usage by switching to a different Scene in OBS. So if I switch away for a minute from my widget-heavy default Scene and go to a stripped down on that just shows my Display Source that I'm drawing in, after about 60-120 seconds it seems to reset the memory to normal levels.

Freakin weird. Am I Patient Zero for a problem like this? I guess this is a temporary solution, but it feels kind of like scooping up buckets of water from the inside of my boat while the leak is still open.
 

Narcogen

Active Member
It's possible that there's a memory leak in the browser library used in the browser module. There are not nearly as many game-focused streamers using OBS on the Mac with a lot of widgets and also doing long sessions, so it's possible that this has gone unnoticed.
 

ianjmiles

New Member
Did this ever get sorted? I'm having the exact same problem!

I just don't understand. OBS running at 64GB??
 

Attachments

  • Screenshot 2020-03-31 at 18.30.53.png
    Screenshot 2020-03-31 at 18.30.53.png
    133.6 KB · Views: 115
Top