in reply to Perl - release memory

If increasing your swap space is impossible for political reasons, the next easiest solution is to fork just before the memory intensive part and do it in the child, saving the results to a file for the parent to read if necessary, then exit. (threads, while a possible solution, would be much messier to implement.)