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

Instance not properly destroyed after calling destroy() #11

Open
GatoVuelta opened this issue Sep 13, 2024 · 1 comment
Open

Instance not properly destroyed after calling destroy() #11

GatoVuelta opened this issue Sep 13, 2024 · 1 comment

Comments

@GatoVuelta
Copy link

GatoVuelta commented Sep 13, 2024

Hello. I discovered my Node.js app was having a high CPU usage even after ending all streams passed to and from the mixer. Looking deeper turned out that the _read() method of the mixer class was being called nonstop (even after removing all inputs and calling mixer.destroy()).

@GatoVuelta GatoVuelta changed the title Instnce Instance not properly destroyed after calling destroy() Sep 13, 2024
@GatoVuelta
Copy link
Author

GatoVuelta commented Sep 13, 2024

The desired result (have _read() to stop and having all buffer memory freed) can be achieved only after calling mixer.close() and then mixer.destroy(), in that order, or by calling the base Readable._destroy() method. Ideally the destroy() method should be enough. And the current behaviour of destroy() should be instead called end() as it currently doesn't implement such method.

Update: CPU usage is related to #5, but was a good indicator that the stream was still going.

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

1 participant