--- old/src/os/windows/vm/os_windows.cpp 2015-12-21 09:40:52.510609871 -0800 +++ new/src/os/windows/vm/os_windows.cpp 2015-12-21 09:40:52.414609875 -0800 @@ -3423,7 +3423,11 @@ // Use VirtualQuery() to get the chunk size. while (bytes_remaining) { MEMORY_BASIC_INFORMATION alloc_info; - VirtualQuery(next_protect_addr, &alloc_info, sizeof(alloc_info)); + ret = VirtualQuery(next_protect_addr, &alloc_info, sizeof(alloc_info)) != 0; + if (!ret) { + return false; + } + size_t bytes_to_protect = MIN2(bytes_remaining, (size_t)alloc_info.RegionSize); // We used different API at allocate_pages_individually() based on UseNUMAInterleaving, // but we don't distinguish here as both cases are protected by same API. @@ -3467,13 +3471,7 @@ // Pages in the region become guard pages. Any attempt to access a guard page // causes the system to raise a STATUS_GUARD_PAGE exception and turn off // the guard page status. Guard pages thus act as a one-time access alarm. - bool use_individual = (UseNUMAInterleaving && !UseLargePages); - bool ret; - if (use_individual) { - ret = protect_pages_individually(addr, bytes, p, &old_status); - } else { - ret = VirtualProtect(addr, bytes, p, &old_status) != 0; - } + bool ret = protect_pages_individually(addr, bytes, p, &old_status); #ifdef ASSERT if (!ret) { int err = os::get_last_error();