Although this is not a specific issue of vertx, but of Java, I would like to know if there is any recommendations or best practice to tune the Java memory when using vertx.
Our experience is that this is the hardest point. We can find two issues:
a) OOM due to exceeding Java heap. It can happen when working with big documents in vertx under stress load. It would be nice if vertx could provide some type of protection (discarding requests that cannot be processed due to lack of memory). Currently, we set -Xmx and -Xms to the same value and relatively high (2GB).
b) Exhaust RAM of the host (Java process captures all of it). We have experienced that Java process does not return all the memory to the OS. We have monitored memory with Java tools and we can confirm that heap never exceeds the Xmx limit and there is no memory leak (apparently). However, when we stress vertx, it looks like Java process takes much more RAM memory than expected, and the performance is degraded due to lack of free RAM memory for the OS. It looks like a well-know Java problem (not vertx specific).
We have tested some JVM parameters but without any benefit (or even with penalty). So, we maintain the default ones except for Xmx and Xms.