diff -r b42cadf7eb4a -r 24c59b1579d7 src/hotspot/os/linux/os_linux.cpp --- a/src/hotspot/os/linux/os_linux.cpp Tue Jun 11 14:33:34 2019 +0530 +++ b/src/hotspot/os/linux/os_linux.cpp Tue Jun 11 10:55:17 2019 +0200 @@ -4105,11 +4105,6 @@ // available (and not reserved for something else). char* os::pd_attempt_reserve_memory_at(size_t bytes, char* requested_addr) { - const int max_tries = 10; - char* base[max_tries]; - size_t size[max_tries]; - const size_t gap = 0x000000; - // Assert only that the size is a multiple of the page size, since // that's all that mmap requires, and since that's all we really know // about at this low abstraction level. If we need higher alignment, @@ -4132,50 +4127,7 @@ anon_munmap(addr, bytes); } - int i; - for (i = 0; i < max_tries; ++i) { - base[i] = reserve_memory(bytes); - - if (base[i] != NULL) { - // Is this the block we wanted? - if (base[i] == requested_addr) { - size[i] = bytes; - break; - } - - // Does this overlap the block we wanted? Give back the overlapped - // parts and try again. - - ptrdiff_t top_overlap = requested_addr + (bytes + gap) - base[i]; - if (top_overlap >= 0 && (size_t)top_overlap < bytes) { - unmap_memory(base[i], top_overlap); - base[i] += top_overlap; - size[i] = bytes - top_overlap; - } else { - ptrdiff_t bottom_overlap = base[i] + bytes - requested_addr; - if (bottom_overlap >= 0 && (size_t)bottom_overlap < bytes) { - unmap_memory(requested_addr, bottom_overlap); - size[i] = bytes - bottom_overlap; - } else { - size[i] = bytes; - } - } - } - } - - // Give back the unused reserved pieces. - - for (int j = 0; j < i; ++j) { - if (base[j] != NULL) { - unmap_memory(base[j], size[j]); - } - } - - if (i < max_tries) { - return requested_addr; - } else { - return NULL; - } + return NULL; } // Sleep forever; naked call to OS-specific sleep; use with CAUTION