I am using function within function in javascript. I am reading files and pass to another function.
For example
function function1()
{
var file1="sample text"; ///for example it takes 2 bytes memory
function2(); ///calling another function
c=a+b;
}
function function2()
{
var file2="another sample text"; //Here another 2 bytes
//do something
}
I need to know how much memory it takes at the time of 'c=a+b' line execution.
Because I have Fatal error while handling large files.
The error :
Fatal Error: CALL_AND_RETRY_LAST ALLOCATION failed. process out of memory.
Note: I have increase memory size by -- max_old_space_size=2000000. But after increase the function. The error again occur.
I am using the above logic(function within function).
I have doubt at variable memory.
Any one assist me.
Thanks in Advance.