- What is your experience? Can you confirm my experimental findings?
- Can I generally use
total RAM - 600 MB, or
0.4 * total RAM?
- Or is it always trial and error, and hoping that it is low enough?
Context: I'm trying to set up jenkins on a T3 instance, experimenting with Ubuntu Server 16.04 and 18.04.
I started with a
t3.micro instance (1 GB RAM), but found the OOM killer killing my java process, as soon as I use more than about
-Xmx400m, which seems kind of low. I was expecting to be able to use more like
Does this mean Ubuntu Server requires about 600 MB to work?
The problem is that the java process starts, even if I set both -Xms and -Xmx to a very high value, like
700m. The process is killed only later when I make the first request to the website.
I now experiment with a
t3.small instance (2 GB of RAM), but am again very unsure about what to configure.
On Windows it is kind of deterministic: I set both
-Xmx to the same value. If the service fails to start, the value was too high. If the service starts successfully, the value is fine, and the memory is reserved for my process.
- Avoid linux out-of-memory application teardown
- Effects of configuring vm.overcommit_memory
- PostgreSQL seems to have a similar problem: https://dba.stackexchange.com/questions/170596/permanently-disable-oom-killer-for-postgres (and https://www.postgresql.org/docs/current/kernel-resources.html#LINUX-MEMORY-OVERCOMMIT)