RAM might be inexpensive, but this hasn't stopped cloud providers from being stingy with RAM and price gouging.
At current RAM prices you'd expect the smallest instances to have 2GB, yet they still charge $4/month for 512MB, which isn't enough to run the average JVM web server.
That is pretty ridiculous complaint. Your problem is that they allow configuring instances smaller than your arbitrary baseline? Especially as AWS allows you to pick 2/4/8 GB per vCPU for general purpose instances. And the smallest of these (c7g.medium) is 2GB/1vCPU. The .5 GB t4g.nano has actually more generous ratio because it also has only .1 vCPU, putting it at 5GB/vCPU.
I'd assume they are very aware of demand levels for different types and would be adjusting the configurations if needed.
RAM is almost free if you’re not on embedded, and embedded could run Java sure, but it isn’t common.