-
Notifications
You must be signed in to change notification settings - Fork 24
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
looks like there is a problem getting a connection after about 20000-30000 requests are processed. #25
Comments
Looks like stack overflow to me. If you use their approach from README, it will cause it, for sure. |
If possible, try and take core dumps periodically, then use chrome debugger
to compare them. This will reveal what's not getting garbage collected.
Heapdump is a package that I'm using in my day job to do that.
…On 29 Dec 2016 1:00 PM, "Vladimir Kanazir" ***@***.***> wrote:
Looks like stack overflow to me. If you use their approach from README, it
will cause it, for sure.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#25 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAQlfARvKPzN_5T1z--11JB48fOO-guwks5rMxs2gaJpZM4IWpln>
.
|
@kanazir What alternative approach would you suggest? |
Well, I am not the expert in node (I used it in only once in small IoT project) but you should not call the function recursively because it will cause stack overflow, eventually (javascript has no tail recursion). The better approach is to emit an event (and call callback function) every time the data is received. For example, serialport does it that way. I hope this helps... |
If that is your concern node version 6.2 supports tail call optimization: |
Using setTimeout(resJob, 0) in the example provided, even if recursive, it would clear the call stack. I have tested it and it is a simpler alternative to using events. |
I'm running a batch process and it hits this error consistently after 20000-30000 jobs.
version 0.1.21
events.js:141
throw er; // Unhandled 'error' event
^
Error: connect EADDRNOTAVAIL localhost:11300 - Local (localhost:0)
at Object.exports._errnoException (util.js:856:11)
at exports._exceptionWithHostPort (util.js:879:20)
at connect (net.js:843:14)
at net.js:938:9
at nextTickCallbackWith0Args (node.js:452:9)
at process._tickCallback (node.js:381:13)
The text was updated successfully, but these errors were encountered: