What is the maximum number of nesting layers of the call stack supported by different programming languages before stackoverflow occurs?
Different programming languages before the occurrence of stackoverflow support the maximum number of nesting layers of the call stack, many novices are not very clear about this, in order to help you solve this problem, the following editor will explain in detail for you, people with this need can come to learn, I hope you can get something.
Today, one of my colleagues posted a picture in the WeChat group, which aroused my curiosity: what is the maximum number of nested layers of recursive calls to functions supported by different programming languages?
Java 1.8private static void recur (int I) {System.out.println ("Stack level:" + I); recur (+ + I);}
Test results: 8644
Javascript in Chrome
Chrome version:
Version 70.0.3538.102 (Official Build) (64-bit)
Function a (I) {console.log ("stack level:" + I) a (iTun1);} a (0)
Test results: 11412
JavaScript in nodejs
Nodejs version: v8.11.3
Test results: 11213
Golang
Version:
Test results: 3947556
ABAPdata: lv_temp type int4.form recur using iv type int4. Sy-index = iv. Lv_temp = iv + 1. Perform recur using lv_temp. Endform. start-OF-SELECTION. Perform recur using 0.
It's actually an out-of-memory error.
Test results: 12258206
Is it helpful for you to read the above content? If you want to know more about the relevant knowledge or read more related articles, please follow the industry information channel, thank you for your support.