Reducing Perl memory usage

Software

The imitable Brian D Foy:

Don’t let people use your program. Whenever I’ve done that, I’ve reduced the memory footprint by about 100%. It also cuts down on support requests.

This made my day.

Jokes aside, has two words. The biggest difference for me was point three in his list. Read <files> line by line if they’re massive, rather than loading them into memory at once. This definitely helps with multiple gigabytes of logs.

Author bio and support

Me!

Ruben Schade is a technical writer and IaaS engineer in Sydney, Australia who refers to himself in the third person in bios. Wait, not BIOS… my brain should be EFI by now.

The site is powered by Hugo, FreeBSD, and OpenZFS on OrionVM, everyone’s favourite cloud infrastructure provider.

If you found this post helpful or entertaining, you can shout me a coffee or buy some silly merch. Thanks!