ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Max recusion for RPGLE procedure calls?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Max recusion for RPGLE procedure calls?

    If I have an RPGLE procedure calling itself recursively, what is the maximum number of calls before it will error? I know it's documented somewhere but I can't find it

  • #2
    There's a limit of 16MB for the total amount of automatic storage that is required by all the programs and procedures on the call stack. When a call is attempted that would cause that limit to be exceeded, the call fails. It doesn't have to be a recursive call that takes it over the limit; it could be any call, even when there's no recursion involved anywhere on the call stack.

    I haven't heard of any specific limit on the number of recursive calls. If there _is_ a limit, I think it would most likely lbe a limit on the number of programs and procedures on the call stack, whether recursive or not. But I haven't heard of any limit on that either.

    Note that the 16MB limit on automatic storage on the program stack doesn't apply to programs and procedures using the teraspace storage model. (Compiled with STGMDL(*TERASPACE).) I don't know whether there's any limit on the total amount of automatic storage for teraspace-storage-module programs and procedures on the call stack.

    Comment

    Working...
    X