This program probably was designed to do everything in-memory such that it fails when the files grow even slightly large. Unfortunately a redesign is in order. Throwing silicon at the problem might be a stopgap .. and, if so, might be the right thing to do. Chips are cheap.