Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

What is the maximum number of nesting layers of the call stack supported by different programming languages before stackoverflow occurs?

Shulou Source: shulou.com Published: 2022-06-01 06:23:10 09月23日 Update

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.

Tags: Results tests support differences max programming languages languages programming versions help clarity curiosity content functions colleagues pictures curiosity actually actually for this Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Redmi MySQL vpn Shulou Information Shulou Tech Info