co-mongo
co-mongo copied to clipboard
Memory Consumption in insert method
I am executing below code around 1Million times and Memory consumed by "insert" gradually get increased and program aborted when all memory consumed. var item = yield productsCollection.insert( p );
can you fix this issue ?
Below is the screenshot of heapdump and its all filled with db objects. If i comment out insert code, loop runs fine till 10 million
http://tinypic.com/r/2qx6jrd/8
Hmm, the code is actually pretty simple: https://github.com/thomseddon/co-mongo/blob/master/lib/collection.js#L59-L69
Would you mind having a look at it?
@thiyaga123 do you have a code sample? This can happen easily as a result of promise chains or tail call's, but since most of that is under the hood of co
and co-mongo
in this case, it'd be useful to see the whole loop. Are there excess closures being created in your loop?
Would be very interested to see a minimal example of this bug