Kurento / bugtracker

[ARCHIVED] Contents migrated to monorepo: https://github.com/Kurento/kurento
46 stars 10 forks source link

Memory leaks when recording files with audio #408

Closed shofel closed 3 years ago

shofel commented 4 years ago

I wrote this a day after the experiment. That is why the data is not strictly accurate.

Versions

Other libraries:

All info about memory and network IO is from docker stats output.

Set up:

What I did

File recorder profile = WEBM

What I done and observed:

  1. Connect 15 senders to KMS. That is 15 tabs in Chrome browser, each sends one media stream.
  2. After all the clients connected, memory consumption continues to grow. It roughly equals to the net IO of the container with Kurento.

File recorder profile = WEBM_VIDEO_ONLY

  1. Connect 15 senders to KMS.
  2. Growth of memory consumption is far less noticeable (reduced by about 3 times)

Also, Common for Both

  1. Close all browser senders.
  2. Memory consumption decreases by ~5MB. It doesn't matter, how much memory was in use - 5MB is freed.
  3. Connect 15 senders again.
  4. Memory usage starts to grow, almost without delay.

We also observed substantial difference in memory usage between mpeg4 and mpeg4 video only profiles of writing files.

Total

j1elo commented 4 years ago

We're missing a proper announcement, but Kurento 6.12 was published with some bug fixes and maybe it improves the situation there, could you try it?

How are you measuring memory usage consumption? Memory usage grows too high warns that using ps or top is a misleading method, and the way to find actual leaks is with Valgrind.

Please run KMS 6.12 with Valgrind to try and find any memory leaks we might have; the process has been hugely simplified, so it's just a matter of following the steps outlined in Building from sources but instead of

bin/kms-build-run.sh

you'll want to do

bin/kms-build-run.sh --valgrind-memcheck

Also please have a look at the information about our Docker image based on AddressSanitizer, in Media Server Crashes. It might help finding issues if you run Kurento with this image.