Obs-studio: [Linux] OBS hogs memory when streaming/recording

Created on 26 Nov 2019  路  9Comments  路  Source: obsproject/obs-studio

The OBS Studio GitHub issue tracker is ONLY to be used for reporting bugs that have replication steps. New features should be discussed on our Discord or Ideas page. For support issues, use the Discord or forums

Expected Behavior

Memory usage should be normal

Current Behavior

After 2 to 9 minutes of streaming/recording obs starts eating more and more memory.

My PC has 16 GB and it eats them all, to the point that my system starts swapping and eventually it freezes completely.

Steps to Reproduce



  1. Install OBS 24.0.3-2 (tested on Arch Linux) either from Arch's repos or from flatpak
  2. Set up a couple of simple scenes with webcam and screen recording (not sure if it happens with an empty scene alone)
  3. Start recording for 2 to 10 minutes
  4. Watch your system hang

Additional information


Using the x264 encoder, fast setting, 4000kbps, main profile

The same problem does not happen on this appimage of an older version by probonopd. This leads me to believe that it's a new bug related to one of the versions in between.

A little note: having Appimage versions would make troubleshooting these kind of issues easier. I was lucky enough to find this build and confirm my suspects, but having official ones, and older builds available to download would be a huge advantage.

Dependency Issue Fix available Mantis Duplicate

Most helpful comment

Spot on, the bug you linked is exactly what I'm experiencing. So to summarize:

The mesa bug fixes have been merged into the master. After I use the master mesa, there is no memory leak. Forgot to say, I can reproduce the memory leak problem before.

supplement:
20 hours of continuous testing, no memory leak. Expect others to add test reports.

All 9 comments

As we do not maintain any packages other than the official Ubuntu package, can you please build from master and see if the same issue occurs?

Just tested, the same problem happens with a fresh build from master (following this section of the wiki)

Provide a log from when the issue occurred.

I cannot replicate it with master on arch linux. After 9 minutes with multiple scenes including one with a v4l2 source memory had not appreciably changed.

If you can find a commit/tag where your issue did not appear and you can replicate the issue please locate the bad commit with a git bisect. This looks like a decent guide on how to use it http://webchick.net/node/99 if you are new to git.

@kkartaltepe thanks, will do tomorrow. Can you provide your specs? I just had the wild idea that maybe my 5700 XT and/or mesa-git drivers might be the culprit

There is an open MESA bug about a memory leak, though that specifically mentioned not needing to start a stream or recording. I am mentioning this here since you mentioned mesa-git drivers.
https://obsproject.com/mantis/view.php?id=1452

That also wouldn't explain why older versions don't cause any problems, and how is it really related considering I use the CPU encoder?

Spot on, the bug you linked is exactly what I'm experiencing. So to summarize:

Spot on, the bug you linked is exactly what I'm experiencing. So to summarize:

The mesa bug fixes have been merged into the master. After I use the master mesa, there is no memory leak. Forgot to say, I can reproduce the memory leak problem before.

supplement:
20 hours of continuous testing, no memory leak. Expect others to add test reports.

This has been fixed upstream.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

DaWe35 picture DaWe35  路  7Comments

gxalpha picture gxalpha  路  9Comments

Marocco2 picture Marocco2  路  9Comments

MVMORADIA picture MVMORADIA  路  6Comments

UserNaem picture UserNaem  路  11Comments