Apparently, the references created in watchFuture and fdbFutureToCallback have to be deleted explicitly in addition to being unref-ed. Just deleting wouldn't be enough either. After applying this patch, the memory usage seems to eventually flatline and Valgrind is reasonably happy.
References must be deleted once they are no longer required by the addon. When a reference is deleted, it will no longer prevent the corresponding object from being collected. Failure to delete a persistent reference results in a 'memory leak' with both the native memory for the persistent reference and the corresponding object on the heap being retained forever.
Resolves #82
Apparently, the references created in
watchFuture
andfdbFutureToCallback
have to be deleted explicitly in addition to being unref-ed. Just deleting wouldn't be enough either. After applying this patch, the memory usage seems to eventually flatline and Valgrind is reasonably happy.From Node-API doc: