Question / Help OBS fills up memory to 100% and crashes

Alan Riplay

New Member
Hi there,

I know that this issue in general has been posted before but unfortunately I couldn't find any solution neither in this forum nor in the worldwide web so I hope it's ok to create a new thread on this.

My problem in short words: Since a few weeks OBS keeps filling up my RAM to 100% and then crashes. I never had these problems before and the only change I can remember is, that I installed the Elgato Stream Deck shortly before I noticed thse issues but even without this hardware attached, the crashes keep coming. Some information on my specs:

Asus ROG G751JY
I7 4710HQ
GeForce GTX 980M
24 GB RAM
256 GB SSD
1TB HDD

Please note that this machine is ONLY used for recording and streaming purposes. The games are running on a different PC and are captured via an Elgato capture card. I record lossless using the utvideo encoder and the files are going to an 3.0 USB external drive. This method has been working well since now...

Enclosed please find a bug report from one of my latest recording sessions.

If you need any more info, feel free to ask. I highly appreciate anyone who takes the time to help me on this;)

Alan
 

Attachments

  • Crash 2017-10-31 23-59-42.txt
    150 KB · Views: 173

sam686

Member
Show us your regular OBS-studio log.

Check device manager, view devices by connection, to make sure your USB HDD is plugged into a faster USB 3.0 eXtensible Host Controller (XHCI) and is not running as a slow USB 2.0 mode. Slow USB 2.0 worsen the bandwidth to about 20 MB/s. A basic file copy or a third party program might be needed to confirm a faster USB 3.0 speed.

Lossless might or might not compress very well depending on the complexity of the capture, and may requires lots of storage speed. Most HDD can only work at about 100 MB/s with fast enough interface (USB 3.0, SATA).
With multiple HDD, can use RAID 0 or windows partition stripped volume for a much faster sequential storage speed, good for recordings. But, USB might not support windows stripped volume.

If you use ffmpeg, show all codec, use RawVideo, here is the constant bitrate/bandwith based on OBS-studio color format, frame rate, and output scaled resolution.
1280x720 30fps NV12/i420 (1.5 bytes per pixel): 57 MB/s
1280x720 30fps i444 (3 bytes per pixel): 83 MB/s
1280x720 30fps RGB32 (4 bytes per pixel): 110 MB/s
1920x1080 30fps NV12/i420 (1.5 bytes per pixel): 108 MB/s

60fps doubles bandwidth from 30fps.
 

Alan Riplay

New Member
Ok, thanks for your hints.

Regarding the USB 3.0 adapter: I didn't change this when the problem occured and due to the problem I have done a clean re-install of Windows 10 including all up-to-date drivers. Maybe it is because the external hard drive is connected to a 3.0 USB hub but that wasn't any issue before?

Now I have done a record session using the RawVideo codec and the result was, that the RAM filled up even faster (didn't take 10 min. to get to 100%). Enclosed you can find the log files from my last 2 sessions and for me it seems like the audio buffering is a big issue? Hopefully you can help me...

Alan
 

Attachments

  • 2017-11-05 00-57-41.txt
    7.9 KB · Views: 51
  • 2017-11-05 01-06-38.txt
    694 bytes · Views: 21

sam686

Member
This is file output buffer overload.
This must mean your external USB HDD is unable to support 114 MB/s required for RawVideo 1280x720 60fps NV12. So OBS-Studio/ffmpeg just endlessly buffers until
"receive_video: Error encoding video: Cannot allocate memory" and everything falls apart to crashing OBS-studio and possibly freezing the entire computer.

You can simply switch to x264 / NVENC with lots of bitrate (higher is better, like 5000 kbps) or constant quality (lower is better). This way, the needed speed of storage will be far less then 10 MB/s (80000 Kbps). QuickSync encoder is an option with compatible CPU (yours is one of them), but only if BIOS/Motherboard have an option to enable intel graphics with intel graphics driver installed. Many laptops don't have this option.

If you need lossless, HDD slowdown can be caused by:
1. Another program accessing the same HDD. If using video editor, make sure video editor is closed while recording.

2. HDD might be failing which can cause severe slow down. You might want to check your HDD health with CrystalDiskinfo. https://www.google.com/search?q=crystaldiskinfo

3. slow USB 2.0. USB 3.0 cable is needed. Plugging into computer's USB 3.0 is needed.
There is a way to block a slow USB 2.0 to force USB 3.0 speed. On a USB 3.0 plug that goes to HDD, use tape to block 2 middle pins to force USB 3.0 speed (3.0 use a row of 5 pins, green in my drawing). Side affect is it blocks and won't work on a USB 2.0 port, but should continue to work on USB 3.0 port if working properly.
tape_to_force_usb3.GIF

My tape idea have solved several users on PS4 consoles's external HDD support that need USB 3.0. (error CE-41902-6)
https://community.playstation.com/c...rals.topic.html/i_am_experiencinger-Mz63.html
If using tape makes USB storage not detected at all, it isn't plugged into the correct USB 3.0 port or cables/hub might be bad.
 

Alan Riplay

New Member
Thanks for your help @sam686! Unfortunately I still need to record lossless as my CPU hasn't got enough power to encode on 1080p during recording. I will buy a new machine by end of the year and hope that this will be capable to do that but until then I will have to go with x264 and lossless. NVENC isn't an option due to the lower quality (same goes for QuickSync).

Therefore I am left with the 3 point you have mentioned for lossless recordings:

1. No other programs are using the external HDD while recording. I made sure on that after reinstalling Windows 10.

2. I checked the HDD with CrystalDiskInfo but unfortunately I can't read the results (or better: understand;). Therefore I have run a test with CrystalDiskMark and enclosed you can find the results. Not sure if they're good? Maybe you or anyone else can help me on this;)

3. I tried this option but will only be able to check if it works by end of the week when I can record again. I will let you know if it solved the problem.

Just another side mark: In OBS I usually use 20000 as video bitrate. This worked until the mentioned issues occured. The usage of the HDD (internal and external) is around 60-80 though. Not sure if this is an information that helps but I thought I just add it...

Again: Thanks for taking your time to help me out...this problem really drives me crazy. Yesterday I ran 3 recording sessions on my internal HDD (which at least doesn't fill up the RAM as when I use the external drive, but as I only got 1 TB of disc space on the internal one, I would rather like to use the external HDD). Afterwards, Adobe Premiere Pro didn't want to accept the .avi-files. I was just about to through the machine out of the window (joking...well, not really). So I used Handbrake to convert the files to MP4 and then it worked. Maybe this is because I haven't installed Quicktime and therefore the .avi codec is missing. Anyway: It just feels like nothing is working currently;(

So...sorry for all the complaining...

Alan
 

Attachments

  • 2017-11-06 15_43_51-CrystalDiskMark 5.5.0 x64.png
    2017-11-06 15_43_51-CrystalDiskMark 5.5.0 x64.png
    98.8 KB · Views: 32

Alan Riplay

New Member
Yesterday I had the chance to make another test run after trying the advise from @sam686, setting up my whole system anew (reinstall of Win 10) and updating my NVidia drivers to the most current version. Unfortunately the problem still occured;(

I have recognized that there's an option in the OBS preferences for my Elgato game capture card that says "buffering". This option was set to "automatic detection" and I am not sure if this might cause the problem? I have deactivated it now and will give it another try this weekend.

This really drives me crazy...Enclosed is the log-file from yesterday's recording session. This time OBS didn't stop working but this was only because I didn't record very long (only about 25 min. which filled up the RAM to 60-70%).

Anyone's got another idea?

Alan
 

Attachments

  • 2017-11-09 23-14-49.txt
    33.5 KB · Views: 12

sam686

Member
Yesterday I had the chance to make another test run after trying the advise from @sam686, setting up my whole system anew (reinstall of Win 10) and updating my NVidia drivers to the most current version. Unfortunately the problem still occured;(
Try FFmpeg output type: URL, File path or URL: NUL. If it works for hours without excessive memory usage, the problem is slow HDD or slow file system.

Note, recording to NUL will pretend it is recording but NUL will record to nowhere, this is only to test encoder's CPU usage and memory usage, cannot playback anything recorded to NUL.

When you do switch back to recording to file on HDD, check task manager's performance and make sure all disks active time are less then 95% usage.
 

Alan Riplay

New Member
Hi again!

First of all: Thanks again for trying to help me out on this. Last saturday I have done some further recording sessions and something really strange happened:

I recorded for around 1 1/2 hour without any problems. That was crazy enough because I used the same settings as before when I had the a.m. problems (lossless recording with utvideo on my external HDD, playing the same game). Then I took a little break of around 10-15 minutes and the only thing I changed was pausing the game (nothing has been touched on the recording machine - the recording was ongoing). When I came back the problem suddenly appeared again! I could track this quite accurate as I had the task manager open all the time and was inspecting the RAM usage every now and then. Before I left everything on it's own the RAM usage was stable at around 300-500 MB (sometimes going up to slightly above 1 GB but dropping after a few minutes again). After I came back the usage started to fill up to the max. again (24 GB).

At that time I was talking to a friend of mine who's quite familiar with IT stuff and has also tried to help me on this the last weeks. Even he was quite helpless and told me that he never heard of anything alike before.

Just to mention what I have done before this recording sessions:

- Completely re-install my laptop (deleting all programs and files via the respective windows option)
- Fully delete the GPU drivers according to the link that @Fenrir posted above
- Only installing the absolutely necessary programs

Yesterday I started another recording session after I formated the external hard drive in the night from saturday to sunday. I used the "long formating method", not the fast version. This time I could record for 2 hours straight without problem. The RAM usage stayed at 300-500 MB with just a few peaks as described above.

I am really at the end of the line when it comes to new ideas...hopefully anyone can help me. If needed, I can search for the log-file from the "mysterious" saturday evening recording session...

Alan

P.S.: @sam686, I forgot to mention that I have not tried your last posted advise regarding the file path "NUL" but will do and inform you what happened.
 
Last edited:

sam686

Member
A single 64-bit programs could easily use up all 24 GB or more memory, but not 32 bit.

You can try 32 bit OBS-Studio. Each 32-bit programs is limited to only 2 or 4 GB of memory, depending if Large Address Aware (in EXE program) is enabled or not.

If OBS-Studio is causing out of memory errors, 32-bit OBS-Studio can only use up to 2 or 4 GB and then the logs will be very noisy with being unable to allocate memory frames or just crashing 32 bit OBS-Studio. If something else is consuming way too much memory (20+ GB), it is not 32-bit programs.
 

Alan Riplay

New Member
Hi there!

Just wanted to let you know that formatting my external HDD seems to have solved the problem. Actually I didn't have this issue since. Therefore it seems quite possible that this drive was just too fragmented...hope it stays this way.

Thanks to all forum members that have helped me on this. I highly appreciate it...

Cheers and have an awesome weekend,

Alan
 
Top