1

So there are parameters to set how much RAM JVM can use by using -Xmx parameter - say -Xmx2g and the program will cap at 2GB of RAM no matter if the system has 4GB or 64GB available, and from what I could gather default is -Xmx256m

But is there a way to make it so that it will use all available memory? Meaning if it runs on a Linux system with say 2GB of physical ram and some other programs using varying amounts of it. And, of course, listening to system requests when the OS wants the program to free some of it?

A somewhat real-case scenario for that in my case is Raspberry PI (and other SBCs) where RAM is quite limited and I'd rather have JVM use as much of it as it can, rather then some fixed amount, that could be not enough.

Miku
  • 567
  • 6
  • 15

0 Answers0