I updated Janus and I’m still having the same memory leak problem. We have recently seen that memory usage has been increasing over time. The number of threads that janus was consuming was 222. Here is the memory consumption information that janus is using.: memory snap - Pastebin.com (4.4GB).
Did you compile Janus with libasan support? If so, notice that libasan will increase memory usage over time, as it will keep track of every single memory allocation until the program is shut down. That said, if libasan is enabled, you can also use libasan to check if there’s any actual leak now: close all sessions and, when Janus is idle, close it cleanly (e.g., with SIGINT or SIGTERM) and libasan should print the memory that’s still allocated at shutdown.
I followed the janus compilation from git. Is libasan a default build configuration? If so, how do I remove it?
No it’s not a default build configuration, usually it needs to be added manually, as explained here. You can check if your instance of Janus is built with libasan by doing something like
ldd /opt/janus/bin/janus | grep asan
which in my local instance that does use libasan prints something like that
libasan.so.8 => /lib64/libasan.so.8 (0x00007fd474400000)
It looks like it wasn’t compiled with libasan, I ran this command and the output was empty.
Note: I ran this command to confirm, but I did not manually compile libasan.
We are monitoring the number of threads and sessions created, and everything is being closed when there is no use. Even so, as time passes, the memory increases until it reaches 100%, and then we have to restart Janus. This started happening after we upgraded from the legacy version to multistream. More or less every 1 week we have to restart the Janus service, because it reaches 100% memory. (8GB)
I am available if you need more information.
I found the problem that was causing a memory leak. I verified that we were running Janus with the command “/opt/janus/bin/janus &”, that is, Janus was running in the backgroung and this was accumulating memory. Problem solved.