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?

Upvotes: 3

Views: 4822

Answers (1)

apangin
apangin

Reputation: 98284

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

Upvotes: 4

Related Questions