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

Safely copy lines to avoid memory leaks #96

Merged
merged 1 commit into from
Mar 18, 2021
Merged

Conversation

harrietwaters
Copy link
Contributor

V8 has garbage collection issues when cleaning up substrings split from strings greater
than 13 characters, so before the lexical parsing we need to safely copy over each line
so that it doesn't hold any reference to the original containing string.

Node Issue for reference: https://bugs.chromium.org/p/v8/issues/detail?id=2869

V8 has garbage collection issues when cleaning up substrings split from strings greater
than 13 characters so before the lexical parsing we need to safely copy over each line
so that it doesn't hold any reference to the original containing string.
@coveralls
Copy link

Coverage Status

Coverage remained the same at 96.473% when pulling cd3db62 on haroldwaters:copy-string into 77918b7 on kuu:master.

@harrietwaters harrietwaters changed the title Safely copy lines to avoid Memory leaks Safely copy lines to avoid memory leaks Mar 17, 2021
@harrietwaters
Copy link
Contributor Author

For more context, we were seeing leaks on the order of MBs per second when generating new playlists with ~3000 segments per rendition. Testing this change as a monkey patch stopped the leak entirely.

@kuu kuu merged commit b9c75f6 into kuu:master Mar 18, 2021
@kuu
Copy link
Owner

kuu commented Mar 18, 2021

Thanks for the PR. I learned a lot 💪

@kuu
Copy link
Owner

kuu commented Mar 18, 2021

Published as hls-parser@0.10.1

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

Successfully merging this pull request may close these issues.

3 participants