This is the mail archive of the libc-help@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Impact of Increasing M_MMAP_THRESHOLD to 1GB in malloc().


++libc-help

Thanks for quick reply .

Yes it is 64 Bit target.

Fragmentation means when malloc() request is more than threshold value,
memory is allocated using mmap().
Due to size alignment with page size, there is memory wastage per request.
e.g. Our system is having 48GB
memory, then  total Number of malloc() requests (each 64MB) will be 380 and
total used memory is 23 GB out
of 48GB.

The system (NEC SX-Aurora TSUBASA) on which we are currently working is
having huge page size and each
process  can have  16 GB and 512 GB address space for 2 MB and 64 MB page
size respectively.

Also there is no particular limit on maximum heap size and Each thread can
easily consumes 2 GB of address
space  and thats why we want to increase the M_MMAP_THRESHOLD to 1 GB.

Best Regards,
Ritesh

On Wed, Sep 26, 2018 at 3:35 PM Florian Weimer <fweimer@redhat.com> wrote:

> * ritesh sonawane:
>
> > I am working on system with page size 2MB and 64MB and use of malloc()
> > leads to fragmentation.
>
> What kind of fragmentation?
>
> > To avoid this I want to increase the size of M_MMAP_THRESHOLD to
> > 1GB. Is there any impact of this on bin index calculation ?
>
> I assume this is for a 64-bit target.
>
> You will also have to increase the heap size (the amount by which thread
> arenas grow), otherwise you will end up with much more fragmenation for
> certain allocation sizes.  This will mean that every thread consumes at
> least 2 GiB of address space.
>
> Thanks,
> Florian
>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]