Search code examples
javajvmjvm-argumentsjvm-hotspot

MaxDirectMemorySize usage


I'm using jdk1.8.0_92. My VM is like the below.

$java -version
java version "1.8.0_92"
Java(TM) SE Runtime Environment (build 1.8.0_92-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.92-b14, mixed mode)

My jinfo for MaxDirectMemorySize is

$jinfo -flag MaxDirectMemorySize 41266
-XX:MaxDirectMemorySize=0

But i don't know how much direct memory will be allocated for that VM. Anyone knows this?


Solution

  • If MaxDirectMemorySize is not specified explicitly, the default limit will be equal to the heap size: Runtime.getRuntime().maxMemory() (the source).