Openwall GNU/*/Linux - a small security-enhanced Linux distro for servers
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Tue, 3 Jul 2018 10:43:31 -0400
From: Rich Felker <dalias@...c.org>
To: musl@...ts.openwall.com
Subject: Re: Changing MMAP_THRESHOLD in malloc() implementation.

On Tue, Jul 03, 2018 at 12:58:04PM +0530, ritesh sonawane wrote:
> Hi All,
> 
> We are using musl-1.1.14 version for our architecture. It is having page
> size of 2MB.
> Due to low threshold value there is more memory wastage. So we want to
> change the value of  MMAP_THRESHOLD.
> 
> can anyone please giude us, which factor need to consider to change this
> threshold value ?

It's not a parameter that can be changed but linked to the scale of
bin sizes. There is no framework to track and reuse freed chunks which
are larger than MMAP_THRESHOLD, so you'd be replacing recoverable
waste from page granularity with unrecoverable waste from inability to
reuse these larger freed chunks except breaking them up into pieces to
satisfy smaller requests.

I may look into handling this better when replacing musl's malloc at
some point, but if your system forces you to use ridiculously large
pages like 2MB, you've basically committed to wasting huge amounts of
memory anyway (at least 2MB for each shared library in each
process)...

With musl git-master and future releases, you have the option to link
a malloc replacement library that might be a decent solution to your
problem.

Rich

Powered by blists - more mailing lists

Your e-mail address:

Powered by Openwall GNU/*/Linux - Powered by OpenVZ