Reputation: 356
We have a DLL that provides access to listening events from "specific" windows app. I've written my custom C++ wrapper for creating bridge between foreign DLL and my Node JS app. Here is a part of code how communication built:
const connectionCallback = ffi.Callback('void', ['string'], (data) => app.eventEmitter.emit(INTERNAL_EVENTS.CONNECTION, data));
const quotesCallback = ffi.Callback('void', ['string'], (data) => app.eventEmitter.emit(INTERNAL_EVENTS.QUOTE, data));
const eventsCallback = ffi.Callback('void', ['string'], (data) => app.eventEmitter.emit(INTERNAL_EVENTS.EVENT, data));
The problem. I've spent 6h on observing usage memory in C++ code only (when i've run it without Node) and node memory leaks were found. I did the same with Node (i've installed heapdump package and compare snapshots on a big distance). According to snapshots no memory leaks in my app were found.
But applications memory usage grows. 300mb on start, 500mb after 2h and near 1gb after 20h. Do you have any ideas what tool we may use to found a leak?
I've found similar topic without answer (node-ffi github issues)that was started in 2013 but i hope that solution already exists :) Thanks.
Upvotes: 0
Views: 340