title: Can the JVM max heap size be dynamic?
body: <p>The JVM -Xmx argument lets one set the max heap size for the JVM to some value.  But, is there a way to make that value dynamic?  In other words, I want to tell the JVM "look, if you need it, just keep taking RAM from the system until the system is out."</p>
  
  <p>Two-part reason for asking:
  First, the app in question can use a really wide range of ram depending on what the user is doing, so the conceptual min and max values are pretty far apart.  Second, it would seem that the JVM reserves the max heap space from virtual memory at boot time.  This particular app is run on a pretty wide variety of hardware, so picking a "one-size-fits-all" max heap space is hard since it has to be low enough to run on low-end hardware, but we'd really like to be able to take advantage of really beefy machines if they're available.</p>