-
Notifications
You must be signed in to change notification settings - Fork 29.7k
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
v8.serialize leaks memory #40828
Labels
v8 module
Issues and PRs related to the "v8" subsystem.
Comments
It doesn't look like you're giving the garbage collector a chance to run. Does the memory get collected once the loop is exited? |
I still see memory surging when I invoke const { serialize } = require("v8");
const { memoryUsage } = process;
for (let i = 0; i < 1 << 22; i++) {
serialize({});
if (i % (1 << 15) === 0) {
gc();
console.log(
`RSS: ${Math.round((memoryUsage().rss / 1024 / 1024) * 100) / 100} MiB`
);
}
} |
Same issue observed on various x86 CPUs and node 16.x and 17x. The issue doesn't seem to occur on my M1 though. |
liuxingbaoyu
added a commit
to liuxingbaoyu/node
that referenced
this issue
Apr 11, 2022
When Buffer::New passes in existing data, it cannot be garbage collected in js synchronous execution. Fixes: nodejs#40828 Refs: nodejs#38300
liuxingbaoyu
added a commit
to liuxingbaoyu/node
that referenced
this issue
Apr 11, 2022
When Buffer::New passes in existing data, it cannot be garbage collected in js synchronous execution. Fixes: nodejs#40828 Refs: nodejs#38300
nodejs-github-bot
pushed a commit
that referenced
this issue
May 2, 2022
When Buffer::New passes in existing data, it cannot be garbage collected in js synchronous execution. Fixes: #40828 Refs: #38300 PR-URL: #42695 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Minwoo Jung <[email protected]>
RafaelGSS
pushed a commit
that referenced
this issue
May 10, 2022
When Buffer::New passes in existing data, it cannot be garbage collected in js synchronous execution. Fixes: #40828 Refs: #38300 PR-URL: #42695 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Minwoo Jung <[email protected]>
juanarbol
pushed a commit
that referenced
this issue
May 31, 2022
When Buffer::New passes in existing data, it cannot be garbage collected in js synchronous execution. Fixes: #40828 Refs: #38300 PR-URL: #42695 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Minwoo Jung <[email protected]>
danielleadams
pushed a commit
that referenced
this issue
Jun 27, 2022
When Buffer::New passes in existing data, it cannot be garbage collected in js synchronous execution. Fixes: #40828 Refs: #38300 PR-URL: #42695 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Minwoo Jung <[email protected]>
targos
pushed a commit
that referenced
this issue
Jul 12, 2022
When Buffer::New passes in existing data, it cannot be garbage collected in js synchronous execution. Fixes: #40828 Refs: #38300 PR-URL: #42695 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Minwoo Jung <[email protected]>
targos
pushed a commit
that referenced
this issue
Jul 31, 2022
When Buffer::New passes in existing data, it cannot be garbage collected in js synchronous execution. Fixes: #40828 Refs: #38300 PR-URL: #42695 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Minwoo Jung <[email protected]>
guangwong
pushed a commit
to noslate-project/node
that referenced
this issue
Oct 10, 2022
When Buffer::New passes in existing data, it cannot be garbage collected in js synchronous execution. Fixes: nodejs/node#40828 Refs: nodejs/node#38300 PR-URL: nodejs/node#42695 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Minwoo Jung <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Version
v17.0.1
Platform
21.1.0 Darwin Kernel Version 21.1.0: Wed Oct 13 17:33:01 PDT 2021; root:xnu-8019.41.5~1/RELEASE_ARM64_T6000 arm64
Subsystem
v8
What steps will reproduce the bug?
Run the following snippet
How often does it reproduce? Is there a required condition?
Must reproduce
What is the expected behavior?
The RSS in the stdout should converges to some tens of MiB. For example, if
v8.serialize
is replaced byJSON.stringify
, the RSS is stablized at 33.89MiB.What do you see instead?
The RSS keeps rising indefinitely.
Additional information
Also affected: v16.0.0
Additional context: babel/babel#13970
The text was updated successfully, but these errors were encountered: