-
Notifications
You must be signed in to change notification settings - Fork 29.6k
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
FinalizationGroup in combination with buffers seems to allocate memory without releasing it #30853
Comments
There's a decent chance it's on the v8 side, check this thread for implementation status: https://bugs.chromium.org/p/v8/issues/detail?id=8179 Also try on Node 13, it's possible the issue has already been fixed. |
Thanks @Jamesernator. I've tried running the script on What's even more interesting, with commented So, maybe it's not related with FG API itself and it's something different? |
This issue may be related with suboptimal behavior of |
Closing this one, as it doesn't seem to be related with node or v8. Feel free to comment if you also experience the same behavior. |
Recently I was working on an experimental Buffer pool implementation based on FinalizationGroup API (see #30683) and encountered a weirdness that I'd like clarify. It seems that node doesn't free memory when
FinalizationGroup
is used to trackBuffer
s (as "holdings") under certain conditions. This issue may be related with off-heap memory allocator or OS memory behavior, but I'd like to confirm that.Here is the most simple reproducer that I could find:
When this script is run under
--harmony-weak-refs
flag, node process consumes about 2GB of physical memory on my machine (and about 2.5GB of virtual memory) and that value doesn't decrease even after 10 minutes.On the other hand, if you comment the
fg.register(slice, buf);
line, you'll see that resident memory consumption eventually goes down to ~32KB (virtual is ~600MB).Once again, I'm not sure if that's a bug, but I'd like to understand the reason of such behavior.
The text was updated successfully, but these errors were encountered: