G0056 : Too many active locals

Hello,

The GAUSS code is giving an error " too many active locals". Does anyone know how to handle this error?

1 Answer



0



'maxlocals' control

The number of allowed concurrent local variables is controlled by the 'maxlocals' setting in the file named gauss.cfg in your GAUSSHOME directory. If you open gauss.cfg and scroll down, you should see a line like this:

maxlocals =     5000       # maximum number of active locals

You can change this to a larger number, like this:

maxlocals =     9000       # maximum number of active locals

for example and restart GAUSS.

Possible cause: infinite recursion

If you cannot resolve the problem by increasing the 'maxlocals' setting to a reasonable number (less than 20000), your problem may be an infinite recursion. Recursion is a programming technique where a function calls its self. Here is a simple example of the type of problem:


b_out = myProc(2, 0.5);

proc (1) = myProc(a, b);
    local tmp;
    //'b' will NEVER be greater than 'a'
    //because 'b' starts at 0.5 and is
    //changed below to bue a uniform
    //random number between 0 and 1
    //while 'a' is 2.
    if b > a;
        retp(b);
    endif;

    tmp = rndu(1,1);
    //Have 'myProc' call 'myProc' over and over
    myProc(a, tmp);
endp;

In the trivial example above, myProc will keep calling itself forever and ever, because a random number (from rndu) will NEVER be greater than 2. Every time this procedure calls itself, more active local variables will be created. Therefore, in this case, increasing the number of allowed active local variables will not help, because the code will keep increasing them forever. For this case, the bug that makes the procedure keep calling its self must be fixed.

aptech

1,323

Your Answer


You must login to post answers.

Have a Specific Question?

Get a real answer from a real person

Need Support?

Get help from our friendly experts.

Try GAUSS for 30 days for FREE

See what GAUSS can do for your data

© Aptech Systems, Inc. All rights reserved.

Privacy Policy