On Wed, 11 Jan 2023 14:49:59 GMT, Thomas Stuefe <stu...@openjdk.org> wrote:

>> Justin King has updated the pull request incrementally with one additional 
>> commit since the last revision:
>> 
>>   Initialize memory to zero in zGranuleMap
>>   
>>   Signed-off-by: Justin King <jck...@google.com>
>
> Curious, I always thought we do ArrayAllocator - using mmap for larger 
> allocations - to prevent memory retention for libc variants whose allocators 
> are "grabby", i.e. which don't promptly return memory to the OS on free(). 
> E.g. because they only use sbrk (Solaris, AIX), or are just cautious about 
> returning memory (glibc).
> 
> Glibc's retention problem is only relevant for fine-grained allocations, so 
> for glibc this is probably fine. This leaves at least AIX as a potential 
> problem. @backwaterred, does the AIX libc malloc() still exclusively use the 
> data segment ? Does free'd memory still stick to the process?
> 
> (While writing this, I remember that we at SAP even rewrote Arena allocation 
> to use mmap for AIX, because large compile arenas caused lasting RSS 
> increase, so it has definitely been a problem in the past)

> > To follow up on @tstuefe comment - and the one that I tried to say in the 
> > bug was that we added this MmapArrayAllocate feature for some G1 marking 
> > bits that used so much memory that hit the Solaris _sbrk issue. Maybe 
> > @stefank and @tschatzl remember this issue. Maybe it's ok for AIX, then 
> > removing this code is a good change. Maybe the G1 usages need a mmap 
> > implementation though.
> 
> The padding.inline.hpp usage seems to have one caller which is called once. 
> The other mmap usage in G1 we can convert to mmap using a similar approach to 
> zGranuleMap if that is preferred. That would then be equivalent behavior, it 
> looks like the G1 code uses the page allocation granularity anyway so maybe 
> keeping it mmap is the better way to go here anyway?

My uninformed opinion (I'm not the G1 code owner) is that it would be fine to 
use explicit mmap. I'd love the complexity reduction this patch brings.

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

PR: https://git.openjdk.org/jdk/pull/11931

Reply via email to