Join GitHub today
http: Eliminate ClientRequest capture by Agent socket listeners #10134
Affected core subsystem(s)
Description of change
Eliminate capture of createSocket callback in onFree/onClose/onRemote listeners by moving them to a separate function.
This reduces the heap usage by eliminating the capture in a prior context of the ClientRequest object associated with the first call that opens a socket. Let me know the best way to provide tests for this, as it's non-obvious to me how to do so.
I have provided a heapsnapshot screen shot in the accompanying issue (#10133), and will attach a similar heapsnapshot screen shot showing usage after this fix is included.
changed the title from
Eliminate capture of "cb" in createSocket context
http: Eliminate capture of "cb" by Agent socket listeners
Dec 9, 2016
@cjihrig Yes, works for me: