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
minor memory leaks fixes #4840
minor memory leaks fixes #4840
Conversation
d6a1c1d
to
2c64736
Compare
Would it work now, with |
No, since the memory allocated by alloca() is free:d as soon as the If I read the code correct it is only used by scheduler threads and the main thread. None of these threads terminates unless the whole vm terminates, so it is no actual memory leak malloc:ing this memory and never free:ing it. |
2c64736
to
209750b
Compare
I kept the suppression in sys_signal_stack.c, let's address it separately. I think now the PR is ready for review (I also rebased it on top of master branch for merge convenience). |
Is there any interest in merging this PR? If not, I'm fine with just closing it. |
Yes, there is interest. I just forgot about this one, sorry. |
CT Test Results 3 files 125 suites 43m 3s ⏱️ Results for commit 3d2b7b6. ♻️ This comment has been updated with latest results. To speed up review, make sure that you have read Contributing to Erlang/OTP and that all checks pass. See the TESTING and DEVELOPMENT HowTo guides for details about how to run test locally. Artifacts// Erlang/OTP Github Action Bot |
I've added a commit that doesn't remove the Preferably you squash these commits. |
erl_process: do not repeat init_misc_aux_work call, avoids small memory leak for misc_aux_work_queues. erl_async: clean up thread progress data on exit
d504e0e
to
3d2b7b6
Compare
Thanks for noticing that, I completely missed the problem (due to lack of async threads usage, I think). |
Running "erl -emu_type asan -eval "erlang:halt()." shows several minor issues straight away. First, init_misc_aux_work is called twice (and first allocation is made orphan), second, when shutting down, async threads don't clean up thread progress data, and - an expected leak, even documented - signal stack.