9

I have what seems to be a huge memory leak in my node.js app, but when I use node-webkit-agent to examine the heap, it seems quite small. I suspect that there may be a whole ton of async operations queued up on the node.js event queue, but I'm not sure how to examine that. Is there any way to do so?

xyz
  • 1,513
  • 2
  • 13
  • 17
  • Possible duplicate of [How can I get a list of callbacks in the Node work queue? (or, Why won't Node exit?)](https://stackoverflow.com/questions/17960452/how-can-i-get-a-list-of-callbacks-in-the-node-work-queue-or-why-wont-node-ex) – Michael Kropat Nov 06 '18 at 20:40

1 Answers1

7

You can check open handles and requests by inspecting the return values of the undocumented functions process._getActiveHandles() and process._getActiveRequests() respectively. That won't get you everything that may be waiting in the event loop, but it should help.

mscdex
  • 104,356
  • 15
  • 192
  • 153