-XX:MaxDirectMemorySize
This Oracle HotSpot option sets a limit on the amount of memory that can be reserved for all Direct Byte Buffers.
Syntax
-XX:MaxDirectMemorySize=<size>
Setting | Value | Default |
---|---|---|
<size> |
[1[k|K|m|M|g|G] or greater] | Depends on maximum heap size |
The value you choose is the limit on memory that can be reserved for all Direct Byte Buffers. If a value is set for this option, the sum of all Direct Byte Buffer sizes cannot exceed the limit. After the limit is reached, a new Direct Byte Buffer can be allocated only when enough old buffers are freed to provide enough space to allocate the new buffer.
By default, the JVM does not set a limit on how much memory is used for Direct Byte Buffers. A soft limit of 64 MB is set, which the JVM automatically expands in 32 MB chunks, as required.