Default for XX:MaxDirectMemorySize

Timur Fanshteyn picture Timur Fanshteyn · Sep 22, 2010 · Viewed 51.4k times · Source

What is the default value for XX:MaxDirectMemorySize?

Answer

leventov picture leventov · Sep 7, 2017

From sun.misc.VM, it's Runtime.getRuntime.maxMemory(), that's what is configured with -Xmx. E. g. if you don't configure -XX:MaxDirectMemorySize and do configure -Xmx5g, the "default" MaxDirectMemorySize will also be 5 Gb, and the total heap+direct memory usage of the app may grow up to 5 + 5 = 10 Gb.