RFR(XS): 8038422: CDS test failed: assert((size % os::vm_allocation_granularity()) == 0) failed when limiting SharedMiscDataSize

Yumin Qi yumin.qi at oracle.com
Fri May 23 17:12:19 UTC 2014

   Thanks for the review.
   For all other platforms than Windows,  vm_allocation_granularity is 
same as vm_page_size.

   From : 

/lpAddress/[in, optional]

    The starting address of the region to allocate. If the memory is
    being reserved, the specified address is rounded down to the nearest
    multiple of the allocation granularity. If the memory is already
    reserved and is being committed, the address is rounded down to the
    next page boundary. To determine the size of a page and the
    allocation granularity on the host computer, use the*GetSystemInfo*
    If this parameter is*NULL*, the system determines where to allocate
    the region.

  In case VirtualAlloc used to reserve memory,  we should align the 
reserve size aligned with dwAllocationGranularity; in case commit 
memory, we should use page size. I have seen some discussions and one 
solution is choose the max of the two.

  We need to tell reserve/commit case for using these two properties. In 
case CDS (or other case reserve/commit combined),  the right way is 
choose max of the two I think.
  My change can prevent reserve space rounded down to nearest multiple 
of page sizes --- which should be multiple of allocation granularity.

   Maybe choose the max of the two is better solution, what do you 
think? This way, we have a uniform on all platforms.


On 5/23/2014 4:11 AM, David Holmes wrote:
> Hi Yumin,
> The change seems simple enough but it does make me wonder if these two 
> functions are being used correctly elsewhere. This isn't an aspect of 
> the VM I'm familiar with.
> David
> On 23/05/2014 5:51 PM, Yumin Qi wrote:
>> Please review
>>    webrev: http://cr.openjdk.java.net/~minqi/8038422/
>>    bug: https://bugs.openjdk.java.net/browse/JDK-8038422
>>    Summary: In debug version, the assert is against
>> os::vm_allocation_granularity(), but in initialization, we use
>> os::vm_page_size() to align the allocation size. In windows,
>> _vm_page_size and _vm_allocation_granularity may not be same.
>>     _vm_page_size = si.dwPageSize;
>>    _vm_allocation_granularity = si.dwAllocationGranularity;
>> This lead to the assertion failed. We should align allocation size with
>> _vm_allocation_granularity.
>>    test: manual testing on Windows.(which is the error on)
>>    JPRT
>>    jtreg
>>    Thanks
>>    Yumin

More information about the hotspot-runtime-dev mailing list