Skip to content

Do not rely garbage collection to free memory of Buffer - #2875

Merged
zcbenz merged 3 commits into
masterfrom
fix-buffer-gc
Sep 23, 2015
Merged

zcbenz merged 3 commits into
masterfrom
fix-buffer-gc

Conversation

@zcbenz

@zcbenz zcbenz commented Sep 23, 2015

Copy link
Copy Markdown
Contributor

It seems that when there are lots of Buffer created the garbage collection callback will be called early for some of them and makes the length of Buffer become zero. It is very likely a bug of V8, but for now we are just working around it by creating internalized ArrayBuffer when possible.

The Node.js part patch is: atom/node@d642464.

Fixes #2809.

@zcbenz

zcbenz commented Sep 23, 2015

Copy link
Copy Markdown
Contributor Author

Or it is not a bug of V8, Node.js didn't move to use the new phantom API of weak handles, and the old API has already been deprecated, that could be the reason of this behavior.

zcbenz added a commit that referenced this pull request Sep 23, 2015
Do not rely garbage collection to free memory of Buffer
@zcbenz
zcbenz merged commit 057c773 into master Sep 23, 2015
@zcbenz
zcbenz deleted the fix-buffer-gc branch September 23, 2015 07:59
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.

1 participant