public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [PATCH 1/2] Add note on MALLOC_MMAP_* environment variables
@ 2016-10-10 17:26 Siddhesh Poyarekar
  2016-10-10 17:26 ` [PATCH 2/2] Document the M_ARENA_* mallopt parameters Siddhesh Poyarekar
                   ` (4 more replies)
  0 siblings, 5 replies; 30+ messages in thread
From: Siddhesh Poyarekar @ 2016-10-10 17:26 UTC (permalink / raw)
  To: libc-alpha

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.

	* 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.
 @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.
 @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.
 @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.
 @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.
 @end table
 
 @end deftypefun
-- 
2.7.4

^ permalink raw reply	[flat|nested] 30+ messages in thread
* [PATCH 0/2] Malloc manual cleanups
@ 2016-10-24 14:08 Siddhesh Poyarekar
  2016-10-24 14:08 ` [PATCH 1/2] Add note on MALLOC_MMAP_* environment variables Siddhesh Poyarekar
  0 siblings, 1 reply; 30+ messages in thread
From: Siddhesh Poyarekar @ 2016-10-24 14:08 UTC (permalink / raw)
  To: libc-alpha

Here's take 2 of the cleanup of descriptions in the manual description in
malloc.  As suggested in previous review, I have made the following changes:

 - Moved up "Efficiency considerations for malloc" into a new subsection called
   "The GNU allocator" that gives a high level description of the allocator
   design and introduces terms like arenas and chunks.  I did not go into too
   much detail here and have instead pointed interested readers to the wiki page
   DJ wrote.

 - Added default values of all of the mallopt parameters

Siddhesh Poyarekar (2):
  Add note on MALLOC_MMAP_* environment variables
  Document the M_ARENA_* mallopt parameters

 malloc/malloc.c    |   1 -
 manual/memory.texi | 153 ++++++++++++++++++++++++++++++++---------------------
 2 files changed, 93 insertions(+), 61 deletions(-)

-- 
2.7.4

^ permalink raw reply	[flat|nested] 30+ messages in thread

end of thread, other threads:[~2016-10-26 12:04 UTC | newest]

Thread overview: 30+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-10-10 17:26 [PATCH 1/2] Add note on MALLOC_MMAP_* environment variables 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 ` [PATCH " Carlos O'Donell
2016-10-17 16:16   ` 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

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).