Want to understand about request
–response
cycle in node.js with clarity. When a signal is terminated by browser, user or due to some network issue, aborted
event is fired on request
object. In this case do both request
and response
objects become automatically invalid/ discarded after read and write streams are closed by node.js and all the associated event listeners (like data
, end
) and other references to the objects are also discarded automatically and they become eligible for automatic garbage collection or all the references still need to be removed manually as part of clean-up job?
Also, what happens after successful completion of request
–response
cycle for the same objects.
I want to understand this as I am concerned about leaving some unwanted references to these objects which will not make them eligible for automatic garbage collection which may lead to memory leak in long run.
Server is behaving normally for short term use. Want to understand the long run scenario.