Running Java OOM


I am trying to run metabase on the starter plan.
In theory metabase can run on 512mb of RAM (I have already made it work).
I set the -Xmx256m -Xss512k flags but it still tries to use 1-2Gig of RAM.
Top does show that VSZ is like 5Gig, so that is probably why the JVM is confused since it only uses 15% of the available memory. Is there a way to hard limit the virtual memory to 512mb?


Hi Sytten,

How are you setting those flags? I believe you can set an environment variable JAVA_OPTS to -Xmx256m -Xss512k in your dashboard and the flags will be passed to your Docker build. Each service on Render is run on a container inside a larger virtual machine so while your application may only have access to 512mb the top command is showing the memory for the larger virtual machine.

I do make use of the environment variable but this only cover the heap memory of my code and not the total memory the JVM can use.
I understand how you seem to do it, but I think you should allow a way to limit the container memory to the plan. I get that some users might want to go over the limit temporarily but for some use cases like the current one this does create problems because the JVM will try to grab as much memory as possible.

I upgraded the instance type to a larger one, but it should not be necessary to do so (I was able to make it work on small 512mb of ram instances in the past). I am thinking something akin to the kubernetes request and limit would be perfect for those advanced use cases.

Hi Sytten,

Apologies for the delayed response, that is a good suggestion. Feel free to submit that to to help us prioritize it. Let me know if there is anything else we can do.

I published it here: Hard limit container memory to plan | Feature Requests | Render