0

-Xmx flag is used to: set the the maximum heap size

while the -XX:MaxRAMPercentage is used to: specify the maximum size of the Java heap as a percentage of the total memory available to the VM

Is it better to use -Xmx or -XX:MaxRAMPercentage? When should each be used?

Natan
  • 1,944
  • 1
  • 11
  • 16
  • Closed as a duplicate, because the discussion under the [linked answer](https://stackoverflow.com/a/54076834/3448419) is exacly about your question. – apangin Apr 11 '20 at 12:44
  • @apangin I saw that Q&A, but it didn't guide me on criteria for when to use each... – Natan Apr 11 '20 at 15:04
  • In our systems, we use `-Xmx` in 100% cases, and I explained in the linked discussion why we do so. I also told how `-XX:MaxRAMPercentage` works. How can I help you further to make a decision? – apangin Apr 12 '20 at 22:06
  • Let me watch your video first, and then I'll decide if I have more questions :) – Natan Apr 13 '20 at 08:21

0 Answers0