Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Out of memory after 10+ hours of streaming #828

Open
jcn50 opened this issue Sep 25, 2020 · 8 comments
Open

Out of memory after 10+ hours of streaming #828

jcn50 opened this issue Sep 25, 2020 · 8 comments

Comments

@jcn50
Copy link

jcn50 commented Sep 25, 2020

Background: I am streaming a window to YouTube, everything is fine and the memory is fine: however after 10+ hours SSR is killed by the system (OOM):

95327.384563] Out of memory: Kill process 10309 (simplescreenrec) score 675 or sacrifice child
[95327.384574] Killed process 10309 (simplescreenrec) total-vm:3232156kB, anon-rss:177232kB, file-rss:0kB, shmem-rss:17168kB
[95327.478200] oom_reaper: reaped process 10309 (simplescreenrec), now anon-rss:16kB, file-rss:0kB, shmem-rss:17168kB

There is nothing valuable in the SSR logs (this is the last lines):

^[[1;33m[Synchronizer::ReadAudioSamples] Warning: Too many audio samples, dropping samples to keep the audio in sync with the video.^[[0m
^[[1;33m[Synchronizer::ReadAudioSamples] Warning: Not enough audio samples, inserting silence to keep the audio in sync with the video.^[[0m
^[[1;33m[Synchronizer::ReadAudioSamples] Warning: Not enough audio samples, inserting silence to keep the audio in sync with the video.^[[0m
^[[1;33m[Synchronizer::ReadAudioSamples] Warning: Too many audio samples, dropping samples to keep the audio in sync with the video.^[[0m
^[[1;33m[Synchronizer::ReadAudioSamples] Warning: Not enough audio samples, inserting silence to keep the audio in sync with the video.^[[0m
^[[1;33m[Synchronizer::ReadAudioSamples] Warning: Not enough audio samples, inserting silence to keep the audio in sync with the video.^[[0m
^[[1;33m[Synchronizer::ReadAudioSamples] Warning: Not enough audio samples, inserting silence to keep the audio in sync with the video.^[[0m
^[[1;33m[Synchronizer::ReadAudioSamples] Warning: Not enough audio samples, inserting silence to keep the audio in sync with the video.^[[0m
^[[1;33m[Synchronizer::ReadAudioSamples] Warning: Not enough audio samples, inserting silence to keep the audio in sync with the video.^[[0m
^[[1;33m[Synchronizer::ReadAudioSamples] Warning: Not enough audio samples, inserting silence to keep the audio in sync with the video.^[[0m
^[[1;33m[Synchronizer::ReadAudioSamples] Warning: Not enough audio samples, inserting silence to keep the audio in sync with the video.^[[0m
^[[1;33m[Synchronizer::ReadAudioSamples] Warning: Not enough audio samples, inserting silence to keep the audio in sync with the video.^[[0m
^[[1;33m[Synchronizer::ReadAudioSamples] Warning: Not enough audio samples, inserting silence to keep the audio in sync with the video.^[[0m
^[[1;33m[Synchronizer::ReadAudioSamples] Warning: Not enough audio samples, inserting silence to keep the audio in sync with the video.^[[0m
^[[1;33m[Synchronizer::ReadAudioSamples] Warning: Not enough audio samples, inserting silence to keep the audio in sync with the video.^[[0m

I have 512MB of physical RAM and 3GB of vSwap.

I cannot understand why it is fine for hours.. and then suddenly the memory usage just explodes?

@MaartenBaert
Copy link
Owner

512MB is really low if you want to do video encoding. I'm not sure though why SSR would use 3.2GB of virtual memory. It would be useful to know how much actual (anon) memory SSR was using, but the error only reports 'resident' memory (i.e. excluding swap).

What is the size of the SSR log? I'm wondering whether the messages in the log window might be using so much memory that it triggered the OOM killer.

@jcn50
Copy link
Author

jcn50 commented Sep 27, 2020

I'm not sure though why SSR would use 3.2GB of virtual memory.

I wanted to know too: I have monitored SSR for a couple of hours but the RAM usage was fine. It is always crashing when I am not monitoring.
I have tried another/better server and it is the same.

It would be useful to know how much actual (anon) memory SSR was using, but the error only reports 'resident' memory (i.e. excluding swap).

I would say the swap was full of SSR's usage!

What is the size of the SSR log?

The log of the last crash was 49KB. There are some other logs files up to 609KB. I have looked at those other logs and they all end abruptly like the one shown above.

If you cannot think of any cause: I will try to test on a 1GB RAM server and come back to you.

@jcn50
Copy link
Author

jcn50 commented Oct 21, 2020

Hi again Marteen,

Very sorry for the late follow-up!

I have tried on a server with 1GB of RAM and I get the same, which is:

  • no specific errors in the logs
  • SSR just closes/crashes

Those are the last lines in the logs:
[Synchronizer::ReadAudioSamples] Warning: Too many audio samples, dropping samples to keep the audio in sync with the video. [Muxer::MuxerThread] Error: Can't write frame to muxer! [Muxer::MuxerThread] Exception 'LibavException' in muxer thread. [Synchronizer::ReadAudioSamples] Warning: Too many audio samples, dropping samples to keep the audio in sync with the video. [Synchronizer::ReadAudioSamples] Warning: Too many audio samples, dropping samples to keep the audio in sync with the video. [Synchronizer::ReadAudioSamples] Warning: Too many audio samples, dropping samples to keep the audio in sync with the video. [Synchronizer::ReadAudioSamples] Warning: Too many audio samples, dropping samples to keep the audio in sync with the video. [Synchronizer::ReadAudioSamples] Warning: Too many audio samples, dropping samples to keep the audio in sync with the video. [Synchronizer::ReadAudioSamples] Warning: Too many audio samples, dropping samples to keep the audio in sync with the video. [Synchronizer::ReadAudioSamples] Warning: Not enough audio samples, inserting silence to keep the audio in sync with the video. [Synchronizer::ReadAudioSamples] Warning: Not enough audio samples, inserting silence to keep the audio in sync with the video. [Synchronizer::ReadAudioSamples] Warning: Not enough audio samples, inserting silence to keep the audio in sync with the video. [Synchronizer::ReadAudioSamples] Warning: Not enough audio samples, inserting silence to keep the audio in sync with the video. [Synchronizer::ReadAudioSamples] Warning: Not enough audio samples, inserting silence to keep the audio in sync with the video. [Synchronizer::ReadAudioSamples] Warning: Not enough audio samples, inserting silence to keep the audio in sync with the video.

I can only things of the options within SSR which I did not try to check/uncheck:

  • Relax shared memory permissions
  • Limit application frame rate
  • Allow frame skipping

Or any other OpenGL errors (I don't know where the logs are?).

@MaartenBaert
Copy link
Owner

If you receive this error message:
[Muxer::MuxerThread] Error: Can't write frame to muxer!
Then you should have also received a more detailed error message from FFmpeg in stderr. If you use the latest version of SSR this message will be combined with the SSR log messages as well. Without the more detailed error message it is impossible to know what went wrong.

Try updating to the latest version of SSR, this will at least improve the error messages.

@jcn50
Copy link
Author

jcn50 commented Oct 23, 2020

Try updating to the latest version of SSR, this will at least improve the error messages.

I have used the apt install simplescreenrecorder within a Debian 10 installation, wasn't that the latest version? 😢

@MaartenBaert
Copy link
Owner

MaartenBaert commented Oct 23, 2020

Debian doesn't update their packages that often. If you want to get the latest version, it's best to compile it yourself. You can clone the git repository and follow the instructions in the readme file. It's not that hard, you just have to install some dependencies and then run ./simple-build-and-install.

Just make sure that you uninstall the simplescreenrecorder package from the repositories first, because otherwise you will overwrite it when you compile it yourself.

@jcn50
Copy link
Author

jcn50 commented Oct 28, 2020

Debian doesn't update their packages that often.

I have just discovered this recently (for other apps!).

Do you know if Ubuntu is having your latest version in its depository?... I do not mind changing the distro.

@MaartenBaert
Copy link
Owner

Ubuntu has the same version as Debian, however if you use Ubuntu you can install it from my PPA (see the instructions on my website) which always has the latest version.

You may also be able to manually download the package from the PPA and install it on Debian instead, but this may result in version conflicts if you can't find a version of Ubuntu that matches the package versions of your Debian installation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants