RFR: Add a limition to allocate object heap in aarch64 with tsan enabled.

Man Cao manc at openjdk.java.net
Mon Apr 20 23:59:41 UTC 2020


On Mon, 20 Apr 2020 08:29:17 GMT, Jie He <github.com+10233373+jhe33 at openjdk.org> wrote:

> Vm will calculate max heap size according to the physical ram if user
> doesn't specify the size(-Xmx). However, with tsan 48-bits memory
> mapping of aarch64, it's hard to allocate the large continuous vm
> space. Heap allocation often fail in this case, thus, add a limitation
> at the end of the heap size calculation to prevent to exceed the
> avaiable size. Currently, only support 48-bits address space.
> 
> Can reproduce the behavior by launching "java --version" in a machine
> with huge physical memory.

Changes requested by manc (Reviewer).

src/hotspot/share/runtime/arguments.cpp line 1859:

> 1858:
> 1859:     // With current TSan memory mapping of 48bit aarch64, it's very hard to allocate large continuous space.
> 1860:     // Add a limitation to avoid the allocation failure in machine with huge physical RAM.

I'm not familiar with this. Is the 48bit aarch64 issue due to implementation detail of LLVM TSAN runtime? Could you add
a link to either documentation or source code for this issue?

src/hotspot/share/runtime/arguments.cpp line 1863:

> 1862:     TSAN_ONLY(
> 1863: #if defined(AARCH64)
> 1864: #define MAX_AVAILABLE_VM_SPACE_IN_AARCH64 (1024ULL * 1024ULL * 1024ULL * 16ULL) //16GB

Could the code be moved to os_linux_aarch64.cpp, by overriding os::has_allocatable_memory_limit()?
There is "reasonable_max = limit_by_allocatable_memory(reasonable_max);" above that calls
os::has_allocatable_memory_limit().

We should avoid adding architecture-specific code in arguments.cpp if possible.

-------------

PR: https://git.openjdk.java.net/tsan/pull/6


More information about the tsan-dev mailing list