If RAM cost is an issue, why not renting dedicated servers? You can rent a dedicated server with 256gb RAM for less than $400/mo on various low cost providers such as Hetzner and OVH.
We don't need anywhere near that much RAM per instance, and we have somewhat bursty traffic. Cloud is a decent fit. I'm willing to pay for the convenience, but that doesn't mean I won't cost-optimize.