Others have made good suggestions regarding algorithm and scope, but for a more complex program you could use Devel::MAT to identify which structures are using the most memory.
See also https://tech.binary.com/tracing-perl-memory-leaks-with-devel-mat/ and https://tech.binary.com/tracing-perl-memory-leaks-with-devel-mat-part-2/
In reply to Re: Reduce RAM required
by swl
in thread Reduce RAM required
by onlyIDleft
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |