Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the default stack size in Node.js?

I know how to set the stack size thanks to: How can I increase the maximum call stack size in Node.js

But, what is the default size? (ie how do I get to the PHP equivalent of phpinfo())

like image 516
blak3r Avatar asked Dec 23 '13 17:12

blak3r


People also ask

What is the default stack size?

Stacks are temporary memory address spaces used to hold arguments and automatic variables during invocation of a subprogram or function reference. In general, the default main stack size is 8 megabytes.

What is maximum stack size?

In Microsoft Windows 2000, if the Microsoft ASP.NET Worker Process (ASPNet_wp.exe) creates a thread, the maximum stack size of the thread is 1 MB. In Windows Server 2008 and higher, the maximum stack size of a thread running on 32-bit version of IIS is 256 KB, and on an x64 server is 512 KB.

How much is stack size?

Stacks are temporary memory address spaces used to hold arguments and automatic variables over subprogram invocations. The default size of the main stack is about eight megabytes.

What is size of call stack in JavaScript?

Without any local variables, each function call takes up 48 bytes during the execution, and you are limited to less than 1MB for all local function frames. Each boolean and number variable takes 8 bytes of memory.


1 Answers

The simple answer is that the default stack size is 492 kBytes (32-bit) and 984 kBytes (64-bit).

As commented by soyuka try this:

$ node --v8-options | grep -B0 -A1 stack_size 

or

$ node --v8-options | grep -B0 -A1 stack-size 
like image 167
Rahul Tripathi Avatar answered Oct 05 '22 02:10

Rahul Tripathi