I have a VPS that uses 1GB of RAM, it has 6-7 apps running in docker containers which isn't the most ram efficient method of running apps.
A light OS really helps, plus the most used app that uses a lot of RAM actually reduce their consumption if needed, but use more when memory is free, the web browser. On one computer I have chrome running with some hundreds of MB used, instead of the usual GBs because RAM is running out.
So it appears that memory is full,but you can actually have a bit more memory available that is "hidden"
If the issue was cost, you would build schools. A better educated population get less sick, earns more and thus pays more taxes, commit way less crimes, get less social welfare, in short it is a net gain in tax dollars.
Plus, someone who gets out of jail with a big debt will very likely cost way more to society than what could ever be recovered from them.