bazukas / obs-linuxbrowser

OBS Linux Browser Plugin
GNU General Public License v2.0
502 stars 47 forks source link

Memory Leak with Stream Labs Alerts + Webm files #102

Closed JeffHoogland closed 5 years ago

JeffHoogland commented 5 years ago

I'm having some memory leak issues with the browser plugin with my stream lab alerts. When I have a day of heavy notifications it gets up to 3+gigs of RAM for just that one browser capture and I have to manually restart it as things start to get laggy.

The browser source is playing webm files for my alerts that all look something like this: https://s3.us-east-2.amazonaws.com/streamlabs-designers/plum/1538083992JeffHoogland_Alert_Sub01.webm

catb0t commented 5 years ago

There's at least one benign leak that comes from simply enabling the source, but it isn't a memory hungry one.

NexAdn commented 5 years ago

Confirmed. I have seen these memory issues, too. I'll have a look at it soon.

NexAdn commented 5 years ago

image

So it seems like the Streamlabs widget is creating more and more listeners without deallocating their memory. At least that's what I see both with Linuxbrowser and Chromium. If that's what causes the high memory usage, there's nothing I can do on my side but to advice you to restart Linuxbrowser every now and then.

I've also checked the code base and I wasn't able to find a memory leak, which could cause OP's memory issues.

The “begin leak” is caused by a missing call to free() for the JS path string. I'll fix that with the next release, but it's definitely not of high priority as the leak consumes only as much bytes as the path to the JS file is long (in characters).