public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Carlos O'Donell <carlos@redhat.com>
To: Siddhesh Poyarekar <siddhesh@sourceware.org>, libc-alpha@sourceware.org
Subject: Re: [PATCH 1/2] Add note on MALLOC_MMAP_* environment variables
Date: Mon, 17 Oct 2016 16:13:00 -0000	[thread overview]
Message-ID: <013af3b4-a6db-dd01-9adf-028ba53daf00@redhat.com> (raw)
In-Reply-To: <1476120388-26662-1-git-send-email-siddhesh@sourceware.org>

On 10/10/2016 01:26 PM, Siddhesh Poyarekar wrote:
> The mallopt parameters manual does not mention the environment
> variables that can be used to set these parameters at program startup.
> Mention those environment variables for completeness.

Please don't get upset with me :-)

I'm asking you to document the default for these env var tunables.

I think it's valid for users to want to know what value they would have
had if they _didn't_ set the environment variable.

Throwing our hands up in the air and saying "it's implementation defined"
isn't very useful IMO.

> 	* manual/memory.texi: Add environment variable alternatives to
> 	setting mallopt parameters.
> ---
>  manual/memory.texi | 15 +++++++++++++++
>  1 file changed, 15 insertions(+)
> 
> diff --git a/manual/memory.texi b/manual/memory.texi
> index 5383105..222f126 100644
> --- a/manual/memory.texi
> +++ b/manual/memory.texi
> @@ -1113,12 +1113,18 @@ choices for @var{param}, as defined in @file{malloc.h}, are:
>  @item M_MMAP_MAX
>  The maximum number of chunks to allocate with @code{mmap}.  Setting this
>  to zero disables all use of @code{mmap}.
> +
> +This parameter can also be set for the process at startup by setting the
> +environment variable @code{MALLOC_MMAP_MAX_} to the desired value.

What's the default?

>  @item M_MMAP_THRESHOLD
>  All chunks larger than this value are allocated outside the normal
>  heap, using the @code{mmap} system call.  This way it is guaranteed
>  that the memory for these chunks can be returned to the system on
>  @code{free}.  Note that requests smaller than this threshold might still
>  be allocated via @code{mmap}.
> +
> +This parameter can also be set for the process at startup by setting the
> +environment variable @code{MALLOC_MMAP_THRESHOLD_} to the desired value.

What's the default?

>  @comment TODO: @item M_MXFAST
>  @item M_PERTURB
>  If non-zero, memory blocks are filled with values depending on some
> @@ -1128,16 +1134,25 @@ use of uninitialized or freed heap memory.  Note that this option does not
>  guarantee that the freed block will have any specific values.  It only
>  guarantees that the content the block had before it was freed will be
>  overwritten.
> +
> +This parameter can also be set for the process at startup by setting the
> +environment variable @code{MALLOC_MMAP_PERTURB_} to the desired value.

What is the default?

>  @item M_TOP_PAD
>  This parameter determines the amount of extra memory to obtain from the
>  system when a call to @code{sbrk} is required.  It also specifies the
>  number of bytes to retain when shrinking the heap by calling @code{sbrk}
>  with a negative argument.  This provides the necessary hysteresis in
>  heap size such that excessive amounts of system calls can be avoided.
> +
> +This parameter can also be set for the process at startup by setting the
> +environment variable @code{MALLOC_TOP_PAD_} to the desired value.

What's the default?

>  @item M_TRIM_THRESHOLD
>  This is the minimum size (in bytes) of the top-most, releasable chunk
>  that will cause @code{sbrk} to be called with a negative argument in
>  order to return memory to the system.
> +
> +This parameter can also be set for the process at startup by setting the
> +environment variable @code{MALLOC_TRIM_THRESHOLD_} to the desired value.

What's the default? Note: There is a limit even with dynamic trim threshold on.

This disables the dynamic trim threshold, and that's a very important thing to
mention.

>  @end table
>  
>  @end deftypefun
> 


-- 
Cheers,
Carlos.

  parent reply	other threads:[~2016-10-17 16:13 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-10 17:26 Siddhesh Poyarekar
2016-10-10 17:26 ` [PATCH 2/2] Document the M_ARENA_* mallopt parameters Siddhesh Poyarekar
2016-10-17 14:04   ` [PING][PATCH " Siddhesh Poyarekar
2016-10-17 16:09   ` [PATCH " Carlos O'Donell
2016-10-18  7:15     ` Michael Kerrisk
2016-10-18 10:07       ` Siddhesh Poyarekar
2016-10-18 13:50         ` Michael Kerrisk (man-pages)
2016-10-18 14:30           ` Siddhesh Poyarekar
2016-10-18 16:03             ` Michael Kerrisk (man-pages)
2016-10-18 16:46               ` Siddhesh Poyarekar
2016-10-18 17:18                 ` Andreas Schwab
2016-10-19  6:53                 ` Michael Kerrisk (man-pages)
2016-10-19  7:09                   ` Siddhesh Poyarekar
2016-10-10 17:33 ` [PATCH 1/2] Add note on MALLOC_MMAP_* environment variables DJ Delorie
2016-10-10 17:42   ` Siddhesh Poyarekar
2016-10-11  6:20   ` Michael Kerrisk
2016-10-11 18:19     ` DJ Delorie
2016-10-11 19:03       ` Michael Kerrisk (man-pages)
2016-10-12 11:57       ` Siddhesh Poyarekar
2016-10-17 19:40     ` Carlos O'Donell
2016-10-11 19:35 ` Kalle Olavi Niemitalo
2016-10-17 14:04 ` [PING][PATCH " Siddhesh Poyarekar
2016-10-17 16:13 ` Carlos O'Donell [this message]
2016-10-17 16:16   ` [PATCH " Siddhesh Poyarekar
2016-10-24 14:08 [PATCH 0/2] Malloc manual cleanups Siddhesh Poyarekar
2016-10-24 14:08 ` [PATCH 1/2] Add note on MALLOC_MMAP_* environment variables Siddhesh Poyarekar
2016-10-26  4:18   ` Carlos O'Donell
2016-10-26  7:58     ` Michael Kerrisk
2016-10-26  9:47     ` Siddhesh Poyarekar
2016-10-26 11:26     ` Rical Jasan
2016-10-26 11:30       ` Siddhesh Poyarekar
2016-10-26 12:04         ` Rical Jasan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=013af3b4-a6db-dd01-9adf-028ba53daf00@redhat.com \
    --to=carlos@redhat.com \
    --cc=libc-alpha@sourceware.org \
    --cc=siddhesh@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).