OBS uses too much virtual memory (after gobbling up all the physical memory).

thadeshammer

New Member
I use a LOT of plugins and push OBS pretty hard, so...the punch line is, this is my fault, and I'm trying to figure out what I did. :) Is there a way to kick in a debug logging mode so I can get more info on what's happening maybe?

Windows Event viewer gave me this warning several minutes before my game (Dorfromantik), OBS, Discord, and Chrome all crashed at the same time.
Code:
Windows successfully diagnosed a low virtual memory condition. The following programs consumed the most virtual memory: obs64.exe (22916) consumed 8734687232 bytes, Dorfromantik.exe (10692) consumed 2674991104 bytes, and Discord.exe (15864) consumed 488222720 bytes.

I have 32GB of physical memory.

I've uploaded the relevant log, but since I went OOM there's not much in there, and no associated crash report.

My hunch is its one of the options I recently started using in the shaderfilter plugin as nothing else about my usage has changed lately, but I'm throwing darts at a board in terms of fixing it. I may need to do a complete rebuild of my scenes (which would be sad, I use a lot of scenes for fun transitions, but maybe that's the problem <_< ).

Thanks so much for a fantastic application, it's brought me a lot of joy.

EDIT. Aside, the log analyzer is very nice; it caught a couple of misconfiguration issues for me, fixed my streaming bitrate and an audio sample rate mismatch in my virtual audio cables. Thanks for that. :)
 
This may be a separate issue, but it just crashed this morning again, idling while I was pouring coffee.

New log upload:

No crash report, however the log Analyzer suggests its due to a video which I don't use the audio for...maybe I can use Davinci to strip the audio from it, but this video I've used for over a year as a source in OBS (Nosferatu, apologies for the typo in source name, the movie is public domain you probably know) so I'm confused as to why it's got a buffering issue now?
 

Attachments

  • obs-bomb.png
    obs-bomb.png
    7.1 KB · Views: 82
  • obs-bomb-max-audio-buffering.png
    obs-bomb-max-audio-buffering.png
    35.9 KB · Views: 84
Apologies if bumping my own (silent) thread isn't copesetic; I'm still trying to find an answer.

Another crash, got a crash report this time.

Here's the associated log:

This time Event Viewer had some info about obs-browser-page.exe crashing. Since it's an OOM thing, might be random what dies and how, but I thought I'd post the xml anyway.
Code:
- <Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
- <System>
  <Provider Name="Windows Error Reporting" />
  <EventID Qualifiers="0">1001</EventID>
  <Version>0</Version>
  <Level>4</Level>
  <Task>0</Task>
  <Opcode>0</Opcode>
  <Keywords>0x80000000000000</Keywords>
  <TimeCreated SystemTime="2021-04-27T22:21:08.5397935Z" />
  <EventRecordID>12076</EventRecordID>
  <Correlation />
  <Execution ProcessID="0" ThreadID="0" />
  <Channel>Application</Channel>
  <Computer>DESKTOP-0RF2MMA</Computer>
  <Security />
  </System>
- <EventData>
  <Data>2050775211870721654</Data>
  <Data>4</Data>
  <Data>APPCRASH</Data>
  <Data>Not available</Data>
  <Data>0</Data>
  <Data>obs-browser-page.exe</Data>
  <Data>0.0.0.0</Data>
  <Data>5ff48647</Data>
  <Data>KERNELBASE.dll</Data>
  <Data>10.0.19041.906</Data>
  <Data>2f2f77bf</Data>
  <Data>e0000008</Data>
  <Data>0000000000034b59</Data>
  <Data />
  <Data />
  <Data>\\?\C:\ProgramData\Microsoft\Windows\WER\Temp\WERB59E.tmp.dmp \\?\C:\ProgramData\Microsoft\Windows\WER\Temp\WERB61C.tmp.WERInternalMetadata.xml \\?\C:\ProgramData\Microsoft\Windows\WER\Temp\WERB62C.tmp.xml \\?\C:\ProgramData\Microsoft\Windows\WER\Temp\WERB62A.tmp.csv \\?\C:\ProgramData\Microsoft\Windows\WER\Temp\WERB64A.tmp.txt</Data>
  <Data>\\?\C:\ProgramData\Microsoft\Windows\WER\ReportArchive\AppCrash_obs-browser-page_f34d63279aeab334d4642fb726bbd657a766829_c0d2e6d8_3691531a-553c-4294-90d6-853dde129db4</Data>
  <Data />
  <Data>0</Data>
  <Data>7b91ede2-7168-4813-8aa6-8d7f8b28a1e1</Data>
  <Data>268435456</Data>
  <Data>6136912400b168e15c75d13091bb1676</Data>
  <Data>0</Data>
  </EventData>
  </Event>

Found an old thread on here with the same errors, that alleges it's because of Voicemeeter running alongside OBS. I did this on a previous system without issue, and the fact that it's a VRAM thing has me thinking it's not Voicemeeter...but I'm grasping at straws.

Has anybody seen anything like this? Thanks so much.
 
This from the previous log (which may correspond to the crash report I uploaded from the time stamps) has something alarming in it.

Code:
19:38:34.112: obs-browser: WS Closed:  (source: https://streamkit.discord.com/overlay/1673efc96b37223f6867.js:38)
19:38:36.168: obs-browser: WebSocket connection to 'ws://127.0.0.1:6470/?v=1&client_id=207646673902501888' failed: Error in connection establishment: net::ERR_CONNECTION_REFUSED (source: https://streamkit.discord.com/overlay/3ca453aad1ff12db27e3.js:24)
19:38:36.168: obs-browser: WS Closed:  (source: https://streamkit.discord.com/overlay/1673efc96b37223f6867.js:38)
19:38:38.224: obs-browser: WebSocket connection to 'ws://127.0.0.1:6471/?v=1&client_id=207646673902501888' failed: Error in connection establishment: net::ERR_CONNECTION_REFUSED (source: https://streamkit.discord.com/overlay/3ca453aad1ff12db27e3.js:24)
19:38:38.224: obs-browser: WS Closed:  (source: https://streamkit.discord.com/overlay/1673efc96b37223f6867.js:38)
19:38:40.296: obs-browser: WebSocket connection to 'ws://127.0.0.1:6472/?v=1&client_id=207646673902501888' failed: Error in connection establishment: net::ERR_CONNECTION_REFUSED (source: https://streamkit.discord.com/overlay/3ca453aad1ff12db27e3.js:24)
19:38:40.296: obs-browser: WS Closed:  (source: https://streamkit.discord.com/overlay/1673efc96b37223f6867.js:38)
19:40:38.055: adding 298 milliseconds of audio buffering, total audio buffering is now 405 milliseconds (source: Noseratu)
 
The app falls down specifically with this same exception and now that I'm getting crash reports (not sure why now and not before?) it's this breakpoint across five threads: obs.dll!os_breakpoint+0x2

I finally broke down and pulled the code down (shout out to open source) and, sure enough, the function os_breakpoint looks to be exclusively tied to a failure to allocate (or reallocate) memory.

Code:
$ grep -r os_breakpoint
docs/sphinx/reference-libobs-util-platform.rst:.. function:: void os_breakpoint(void)
libobs/util/bmem.c:             os_breakpoint();
libobs/util/bmem.c:             os_breakpoint();
libobs/util/platform-nix.c:void os_breakpoint()
libobs/util/platform-windows.c:void os_breakpoint(void)
libobs/util/platform.h:EXPORT void os_breakpoint(void);

Code:
void *bmalloc(size_t size)
{
    void *ptr = alloc.malloc(size);
    if (!ptr && !size)
        ptr = alloc.malloc(1);
    if (!ptr) {
        os_breakpoint();
        bcrash("Out of memory while trying to allocate %lu bytes",
               (unsigned long)size);
    }

    os_atomic_inc_long(&num_allocs);
    return ptr;
}

void *brealloc(void *ptr, size_t size)
{
    if (!ptr)
        os_atomic_inc_long(&num_allocs);

    ptr = alloc.realloc(ptr, size);
    if (!ptr && !size)
        ptr = alloc.realloc(ptr, 1);
    if (!ptr) {
        os_breakpoint();
        bcrash("Out of memory while trying to allocate %lu bytes",
               (unsigned long)size);
    }

    return ptr;
}

So, either OBS (or a plugin) or some other application on my system has a leak that I haven't managed to spot yet, which indicates that it's maybe a fast growing over-allocation, which - when it happens - chokes out several other applications (typically my web browser - either Chrome or Firefox, both have died - and OBS).

Since this thread is silent except for me, I'm guessing nobody else has seen behavior like this. :\ So I'll update if I ever figure it out.

EDIT. No, it's definitely OBS. From Windows Event viewer:
Code:
Windows successfully diagnosed a low virtual memory condition. The following programs consumed the most virtual memory: obs64.exe (5096) consumed 2629918720 bytes, firefox.exe (24924) consumed 779804672 bytes, and steamwebhelper.exe (13592) consumed 350822400 bytes.
 
Last edited:
Nosferatu (which I'd been using for months and months) kept coming up in the logs with that audio issue, so I finally used Davinci to strip the audio from it entirely to resolve that issue.

The issue of the 20:38:43.855: effect_setval_inline: invalid data log line I get in huge swaths is I'm pretty sure one of the shaderfilter presets I tweak and use, and the log line has been happening all along without any crashes, until now.

Is there a way to turn on debug logging for OBS? If anybody knows, I'd really appreciate it.
 
Hi! Have you fixed that problem? I have the same issue.
I haven't had a crash event fitting this fingerprint in many months, suggesting that - somehow - the audio from that one video was actually the culprit. That seems like a bug in OBS which I wasn't able to track down. Initially the video was pulled down from YouTube and that worked fine; I made some edits then encoded it from Davinci to what I thought was the proper format but I bet that was the issue for me; stripping out the audio and it's just fine.

I would doubt it's video size so my hunch is still something to do with the audio encoding, but I'm sorry to say I'm not sure. :\
 
Back
Top