-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
longStackTraces memory issue #447
Comments
Can you use the latest version? The memory leak was fixed in 2.4.3 (But don't use that exact version, as it caused several regressions which were later fixed) |
Hi, node x64 0.10.28 |
Just updated to 2.6.4 still same problem :( |
I can fix the memory leak but the given code will still keep using maximum memory because it runs synchronously. However if you do |
I've got the same problem also using an async function like in the following code: var Promise = require( 'bluebird' );
Promise.longStackTraces();
var SIZE=1024*1024;
var asyncFun = function() {
return new Promise( function( res ) {
setTimeout( function() {
var arr = [];
for( var i=0; i<SIZE; i++ ) {
arr.push( {} );
}
return res( arr );
}, 100 );
} );
};
function crawlLoop() {
return asyncFun()
.then( crawlLoop );
// .then( function() { setImmediate( crawlLoop ); } );
}
crawlLoop(); |
Fixed in 2.7.1, the original code stays at 100MB working set |
Thanks! |
Hi,
i have a memory issue using
Promise.longStackTraces()
. I tried to create an "infite loop" for a crawler and noticed a huge memory usage for the application; i debugged the application and found a strange behaviour.The following code illustrates the problem:
After a few tentatives i noticed that by removing
Promise.longStackTraces()
the problem was solved.Another solution is to call
setImmediate
in the last then of the promise like:Can someone please explain me what is wrong with the code (a part for the infinite loop)?
My configuration:
node x64 0.11.13
Windows x64
Bluebird: 2.3.11
Thanks!
The text was updated successfully, but these errors were encountered: