4837564: (bf) Please make DirectByteBuffer performance enhancements
Alan Bateman
Alan.Bateman at oracle.com
Mon Oct 11 07:50:46 PDT 2010
A long standing gripe for many is that direct buffers are page aligned
with the result that the memory usage can be significantly higher than
expected. We've never documented the alignment and I'm not aware of
anyone that depends on it (if you do then speak up now!). The patches
here change the implementation so these buffers aren't page aligned by
default. A new VM option is introduced to force page alignment if
really needed. Mapped buffers will of course continue to be page aligned.
A related issue is that the addition of the management interface for
buffer pools subtly changed the semantics of the MaxDirectMemorySize
option. That option used to set a limit on the total capacity of all
direct buffers, whereas now it limits the total memory size. This is bug
6743526, and the webrev includes the changes to restore the original
semantics (which is course is only interesting when these buffers are
page aligned).
The webrev with the changes is here. I'm only looking for a reviewer for
the changes to the jdk repo as I will be going to hotspot-runtime-dev
for the hotspot change.
http://cr.openjdk.java.net/~alanb/4837564/
Thanks,
Alan.
More information about the nio-dev
mailing list