[ZGC] [aarch64] Unable to allocate heap for certain Linux kernel configurations

Florian Weimer fweimer at redhat.com
Fri Aug 28 20:21:45 UTC 2020


* Stefan Karlsson:

> Maybe I misunderstand this point, but we use fixed addresses when we
> probe the address space, but we don't use MAP_FIXED:
>
> static bool map(uintptr_t start, size_t size) {
>   const void* const res = mmap((void*)start, size, PROT_NONE,
> MAP_ANONYMOUS|MAP_PRIVATE|MAP_NORESERVE, -1, 0)
>
> bool ZVirtualMemoryManager::reserve_contiguous_platform(uintptr_t
> start, size_t size) {
>   // Reserve address views
>   const uintptr_t marked0 = ZAddress::marked0(start);
>   const uintptr_t marked1 = ZAddress::marked1(start);
>   const uintptr_t remapped = ZAddress::remapped(start);
>
>   if (!map(marked0, size)) {

Note that you can speed this up a little bit on recent-ish kernels if
you use MAP_FIXED_NOREPLACE.

Thanks,
Florian




More information about the hotspot-gc-dev mailing list