Meaning of -XX:MaxDirectMemorySize

Alan Bateman Alan.Bateman at Sun.COM
Thu Mar 5 20:26:07 UTC 2009

Mark Reinhold wrote:
> :
> The original intent was to limit the total capacity, measured in bytes,
> of all direct buffers.  Additional memory allocated due to rounding the
> size of each direct buffer up to the nearest page size was not to be
> counted.
> We assumed that large pages wouldn't be an issue -- is that what you're
> running into?
Thanks for the clarification. The issue is the difference as the 
alignment currently costs an additional page per buffer. This is hard to 
explain to those trying to constrain the memory usage via the option. 
It's mostly an issue with applications that allocate small buffers 
rather than slicing big buffers. Large pages can be problem also (esp. 
the T1/T2 as they can support up to 256MB pages to compensate for the 
small TLB). At some point we'll need to re-visit the alignment, perhaps 
by having an option to not align.


More information about the core-libs-dev mailing list