screenshot-stream icon indicating copy to clipboard operation
screenshot-stream copied to clipboard

Kill phantom process

Open JacksonGariety opened this issue 8 years ago • 2 comments

Phatom itself doesn't seem to leak memory for me, however, when I close the screenshot stream, it seems like about ~40mb of data get left behind resulting in a serious memory leak.

I'm assuming that phantom is leaving something hanging around on its end, or not exiting?

It happens every time the node server throws Error: ECONNRESET.

JacksonGariety avatar Jun 06 '16 09:06 JacksonGariety

I only write this as an issue here since I've attached an on('error') to every stream in my server, yet memory continues to leak. Perhaps a stream is getting left behind in index.js?

This one, maybe: https://github.com/kevva/screenshot-stream/blob/master/index.js#L56

JacksonGariety avatar Jun 06 '16 09:06 JacksonGariety

Not much we can do based on this information, but you could probably use node --inspect in latest Node.js version to inspect memory usage using DevTools and see where it's coming from.

sindresorhus avatar Apr 24 '17 10:04 sindresorhus