in reply to Memory consumption with

You might want to look at using child processes (via something like Parallel::ForkManager or the like) instead, as those will release their resources back to the OS when the child exits.