The problem is not that your variables keep grabbing more memory without releasing it--they aren't. The problem is that test() is calling itself recursively. Each call requires the allocation of a certain amount of stack space, which is released when the function exits, but in this case it never does so the call frames just pile up.
Perl does do tail calls, just not automatic ones. Change that last test() into a goto &test and see if that doesn't make things much better.
In reply to Re: Perl Not Releasing Memory
by Elian
in thread Perl Not Releasing Memory
by rekcah
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |