MAXRECURSELEVEL

Maximum number of recursion levels

WSupported on Windows
USupported on Unix
VSupported on OpenVMS

 

MAXRECURSELEVEL enables you to specify a limit that is greater than the default 1500 levels of method, function, or subroutine calls (or the maximum for the system stack, if it is less, as on 64-bit Windows).

The maximum number of recursion levels that can occur before an error is generated.

By default, the runtime detects when approximately 1500 levels of method, subroutine, or function calls (or the maximum for the system stack) have been made and generates a fatal “Runtime stack overflow” error (STKOVR) when that level is exceeded. If the system stack allows, you can set MAXRECURSELEVEL to a value greater than 1500 to override the limit.

Important

Based on the system stack, the specified value may or may not be possible. If it is not possible, your program could stop running without warning.

The environment.

Runtime

On Unix,

MAXRECURSELEVEL=2500    ;export MAXRECURSELEVEL