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.