http://www.perlmonks.org?node_id=646617


in reply to using a perl LoL and almost running out of memor

undef @confidence_mtx;
How about @batch_lines? Are you also clearing that one?

The program finished, but then the perl process is killed, the memory is not freed.

That sounds unlikely. After the perl process is finished, all its resources (including memory) should be freed by the OS.