-
-
Notifications
You must be signed in to change notification settings - Fork 211
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
Question: Roadmap, Project Status, Things in General. #464
Comments
v5 is stable and is already in use in production. See Hydrogen as an example. There are a couple of issues with v6:
1) socket with inproc close
in gc finalizer
should release reference to context:
AssertionError: expected false to equal true
+ expected - actual
-false
+true
at Context.<anonymous> (test/unit/socket-close-test.ts:156:16)
2) socket with tcp close
in gc finalizer
should release reference to context:
AssertionError: expected false to equal true
+ expected - actual
-false
+true
at Context.<anonymous> (test/unit/socket-close-test.ts:156:16)
3) socket with ipc close
in gc finalizer
should release reference to context:
AssertionError: expected false to equal true
+ expected - actual
-false
+true
at Context.<anonymous> (test/unit/socket-close-test.ts:156:16) Any contribution to fix the issues is appreciated. |
Thank you. I'll try to have a look into the memory leak issue whenever I can (NB: haven't used C++ for ages, could take time). |
This comment was marked as abuse.
This comment was marked as abuse.
This comment has been minimized.
This comment has been minimized.
This comment was marked as abuse.
This comment was marked as abuse.
This comment has been minimized.
This comment has been minimized.
This comment was marked as abuse.
This comment was marked as abuse.
This comment was marked as abuse.
This comment was marked as abuse.
@aminya re memory leaks: tried my best, but I have no idea why it is leaking (either because of my C++ knowledge or the NAPI). I'll just provide what I tried and maybe it will be useful for you. Something interesting I found here: https://github.com/zeromq/zeromq.js/blob/master/src/socket.cc#L79 which creates a strong reference to the context that was passed and when the socket is garbage collected, it unrefs the context, but the context destructor itself is being called after a few seconds (this, I don't understand why). Even if I don't reset the ref, it has the same behavior. When I set the weak reference, it worked, but it's not the correct behavior, because if context will be garbage collected, Here's the sample code that reproduces it: const weak = require("weak-napi")
const zmq = require("./lib")
const task = async () => {
let context = new zmq.Context()
new zmq.Dealer({context})
weak(context, () => {
console.info("memory freed")
})
context = undefined
global.gc()
}
async function run() {
await task()
global.gc()
/*
* but if I run setImmediate(() => global.gc())
* then it works.
*/
// if I remove this, I get SIGSEGV
setInterval(() => {}, 1000) // keep the event loop busy
}
run() logs I get from SIGSEGV (if I won't keep event loop busy & call gc in the main loop)
|
@aminya Let's move the memory leak troubleshooting to its own issue. |
@aminya and @overflowz Let's move the memory leak discussion here: #466 |
That's a good idea. I will close this in favor of #466 |
I'm sure this question was asked previously quite a lot, but it's hard to track everything together, so I'm asking them here:
Thank you.
The text was updated successfully, but these errors were encountered: