-
-
Notifications
You must be signed in to change notification settings - Fork 10
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
Memory leak in 7.2.0 #99
Comments
2nd that, but our leak happens with 7.1.2 too. Reported in #96. Which was not fixed by 7.2.0 (or 7.2.0 introduced a new leak). |
Update; I may have upgrade from 7.1.1, not 7.1.2. I will recheck this later today or at least this week. I see I downgraded to 7.1.1 on the system affected. |
Can you help to confirm that if you were using the sync api, i.e. |
Can confirm sync ops with buffer |
2nd that |
Sorry I've been so busy with work lately. Start looking at this issue today |
This looks like a snappy issue (rather than napi itself): Line 46 in 7116824
Sync api doesn't release refereneces so buffers are kept in memory. Though it's a bit strange to me that async api does into_ref() and unref() only once. |
Incidentally, you should use the async apis if possible as it utilize the libuv threads of Node.js so it should be more performant and won't block Node.js's main thread. |
Hi, I'm currently burried in work and it is not trivial to test different version (must stop current service, reprocess massive amount of data). Hopefully I will get some time tomorrow or wednesday |
It will be couple of days here too, before I have the time to set up the test. |
Hi, first off, a big thank you for finding the ghosts I've been trying to catch for weeks. We also heavily (de)-compress buffers synchronously. Upgrading to 7.2.1 unfortunately did not fix the memory leak, while downgrading to 7.1.1 did. Node v16.18.0
|
@kevcodez please try 7.2.1 |
@Brooooooklyn That's what I did - the memory leak persists. We've had this memory leak shortly after upgrading to 7.1.2 for a few weeks now and could not pinpoint it due too many other changes. We ran 7.2.1 for a few hours and the memory leak was clearly not fixed. After downgrading to 7.1.1, we can clearly see, that the memory leak is gone. Here's a screenshot of the average memory usage in the past 24h. The hard drops are restarts due to out-of-memory exceptions or new deployments. |
Switch the code to v7.1.1 and rebuild, I could see that v7.1.1 do retains low memory usage(about 80~120MB) compared to v7.2.1 (about 360MB) in my Mac, with same napi version, Node.js version and test code. But I can't see clear memory leaks of v7.2.1, compared to v7.2.0 of which memory usage increases to 3GB+ very quickly with sync api. |
Upgrading from 7.1.2 to 7.2.0 caused a memory leak in my application. We use snappy heavily to compress/decompress (synchronously) massive amount of data.
I can enable/disable leak by changing snappy version and nothing else. Will slowly eat memory until app crashes in 7.2.0, while will continue forever in 7.1.2
The text was updated successfully, but these errors were encountered: