Honestly I’d just pay for more memory. Running out means you need more, but not necessarily that you’re doing "too much" or architected wrong. Adding more is the simplest, most predictable, and considering your time, almost certainly the cheapest option.