0

We're configuring a JVM to deploy a server application with Java 11. Turns out our VM has a limit of 1.3G of RAM and we assigned the JVM the following config:

-Xms512m
-Xmx1024m

Turns out that when we start the VM it says that there is not enough memory for the application to start. (Due to security reasons I cannot place the error message here -_-).

We tried to run the app on a local machine and found out it is consuming more memory than intended with the help of VisualVM. Check the Max Value, is beyond 1GB

We found that the JVM is capable of adding more memory than intended, our question is: Which memories affect this "extra" allocation of memory? We tried with Perm (deprecated) of course but we don't have an idea about which specific flags might affect the difference

trincot
  • 317,000
  • 35
  • 244
  • 286
  • 2
    Does this answer your question? [Java using much more memory than heap size (or size correctly Docker memory limit)](https://stackoverflow.com/questions/53451103/java-using-much-more-memory-than-heap-size-or-size-correctly-docker-memory-limi) – PiRocks Apr 06 '20 at 23:17
  • 1
    The link shared by @PiRocks is excellent and must-read. You shouldn't indeed set -Xmx to 1G if the machine has only 1.3 GB available ram because then there's not enough space for the JVM itself and possibly other OS processes. Without knowing anything about your application and environment I wouldn't set -Xmx to more than ~800 MB. You could also filter sensitive parts of the error message and post it here. – Juraj Martinka Apr 07 '20 at 09:05
  • Yes indeed! I appreciate your responses @JurajMartinka and @PiRocks! Regards! – Emanuel Avendano Apr 07 '20 at 15:22

0 Answers0