RFR: 10: 8160638: solaris JVM unable to allocate more than 2GB of direct byte buffers when max heap is <= 2GB

David Holmes david.holmes at oracle.com
Tue Apr 18 04:03:24 UTC 2017

Hi Vladimir,

On 10/04/2017 11:30 PM, Vladimir Kempik wrote:
> Hello
> Please review this fix for bug JDK-8160638
> <https://bugs.openjdk.java.net/browse/JDK-8160638>
> The issue is with solaris only.
> When java mmaps heap (with compressed Oops enabled), mmaped heap become
> upper limit for any native mallocs.
> So when heap is starting at 2 gb, the maximum we can malloc is 2gb.
> Native malloc is used by Direct Memory Buffers, so even with
> -XX:MaxDirectMemorySize=100g we are still limited with less than 2 gb of
> memory for Direct Memory Buffers.
> The fix moves HeapBaseMinAddress to upper space when it's needed for
> MaxDirectMemorySize to operate properly, leaving about 1 gb of native
> memory for java's needs.

Why is this not handled directly in Arguments::set_heap_size()?

I admit I'm unclear about the "magic numbers" involved here. From the 
bug report we have to have a heap >2G for things to work okay. So not 
sure why we adjust the HeapBaseMinAddress the way you do, or why 1GB is 
significant in the calculations ??

May be best for a GC person to review this.


> Testing: jprt, included testcase.
> Webrev - http://cr.openjdk.java.net/~vkempik/8160638/webrev.00/
> Bug - https://bugs.openjdk.java.net/browse/JDK-8160638
> Thanks, Vladimir

More information about the hotspot-runtime-dev mailing list