I am parsing a large number of files using nodejs. In my process, I parse audio files, video files, and the rest.
The function for analyzing files is as follows:
var parseOthers = function(arr, cb, others) {
others = others === undefined ? [] : others;
if(arr.length == 0)
return cb(others);
var e = arr.shift();
others.push(e);
return parseOthers(arr, cb, others);
});
Full code here (take care of it)
Now with approximately 3565 files (not so many), the script will catch the exception "RangeError: Maximum call stack size exceeded", without tracing.
What I tried:
- I tried to debug it with
node-inspectorand node debug script, but it never freezes, as if it worked without debugging (does the assembly debug the stack?). - I tried to
process.on('uncaughtException')catch an exception without success.
I have no memory leak.
How can I find an exception trace?
Change 1
--stack_size . ?
( 1300)
2
:
$ node --v8-options | grep -B0 -A1 stack_size
( kBytes) 984.
3
:
, nodejs, ...