-
-
Notifications
You must be signed in to change notification settings - Fork 35.6k
Memory leak due to process.fork()? #15651
Copy link
Copy link
Closed
Labels
child_processIssues and PRs related to the child_process subsystem.Issues and PRs related to the child_process subsystem.confirmed-bugIssues with confirmed bugs.Issues with confirmed bugs.
Metadata
Metadata
Assignees
Labels
child_processIssues and PRs related to the child_process subsystem.Issues and PRs related to the child_process subsystem.confirmed-bugIssues with confirmed bugs.Issues with confirmed bugs.
Type
Fields
Give feedbackNo fields configured for issues without a type.
I am experiencing memory leakage in an app that uses
process.fork()a lot. These child processes get sent messages viaprocess.send()with asendHandleand are terminated later on.I did run into issues with memory management here. Some heap dumps show that even after the child-processes exited, the
ChildProcess-instances are retained in the master process. I learned that usingsubprocess.disconnect()partly fixes that issue, but one more retainer can be found here:node/lib/net.js
Line 1665 in 20259f9
How, where and when should this
socketListbe removed from the_workers-array?