-
-
Notifications
You must be signed in to change notification settings - Fork 34
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
@node-rs/crc32: rss memory leak #655
Comments
@tuyennhv these are two separate issues, memory leak could be resolved by upgrade to latest NAPI-RS: napi-rs/napi-rs#1331, I can confirm it was fixed in local. The second is globally declared the memory goes to normal if I move the - const bytes = Buffer.alloc(1000);
async function memTest() {
const count = 1_000_000_000;
for (let i = 0; i < count; i++) {
+ const bytes = Buffer.alloc(1000);
crc32c(bytes);
if (i % 100_000 === 0) {
await new Promise((resolve) => setTimeout(resolve, 100));
const {heapTotal, rss} = process.memoryUsage();
console.log(
"Memory usage",
Math.floor((i * 100) / count) + "%",
"heapTotal",
toMem(heapTotal),
"rss",
toMem(rss)
);
}
}
} |
@Brooooooklyn thanks for your quick response and investigation, looking forward to seeing your new release! |
I've noticed memory leaks on |
Publishing |
Published |
thanks @Brooooooklyn 🙏 |
The below code snippet can reproduce the memory leak issue
Heap memory is kept stable but rss keeps increasing, some sample outputs:
This happens even with the latest version (1.5.1)
Found it from ChainSafe/node-snappy-stream#16
The text was updated successfully, but these errors were encountered: