1 <?xml version='
1.0' encoding='UTF-
8'
?>
2 <?xml-stylesheet type=
"text/xsl"
3 href=
"http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl"?>
4 <!DOCTYPE refentry PUBLIC
"-//OASIS//DTD DocBook XML V4.4//EN"
5 "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
10 <title>User Manual
</title>
11 <productname>jemalloc
</productname>
12 <releaseinfo role=
"version">@jemalloc_version@
</releaseinfo>
15 <firstname>Jason
</firstname>
16 <surname>Evans
</surname>
17 <personblurb>Author
</personblurb>
22 <refentrytitle>JEMALLOC
</refentrytitle>
23 <manvolnum>3</manvolnum>
26 <refdescriptor>jemalloc
</refdescriptor>
27 <refname>jemalloc
</refname>
28 <!-- Each refname causes a man page file to be created. Only if this were
29 the system malloc(3) implementation would these files be appropriate.
30 <refname>malloc</refname>
31 <refname>calloc</refname>
32 <refname>posix_memalign</refname>
33 <refname>aligned_alloc</refname>
34 <refname>realloc</refname>
35 <refname>free</refname>
36 <refname>malloc_usable_size</refname>
37 <refname>malloc_stats_print</refname>
38 <refname>mallctl</refname>
39 <refname>mallctlnametomib</refname>
40 <refname>mallctlbymib</refname>
41 <refname>allocm</refname>
42 <refname>rallocm</refname>
43 <refname>sallocm</refname>
44 <refname>dallocm</refname>
45 <refname>nallocm</refname>
47 <refpurpose>general purpose memory allocation functions
</refpurpose>
49 <refsect1 id=
"library">
50 <title>LIBRARY
</title>
51 <para>This manual describes jemalloc @jemalloc_version@. More information
52 can be found at the
<ulink
53 url=
"http://www.canonware.com/jemalloc/">jemalloc website
</ulink>.
</para>
56 <title>SYNOPSIS
</title>
58 <funcsynopsisinfo>#include
<<filename class=
"headerfile">stdlib.h
</filename>>
59 #include
<<filename class=
"headerfile">jemalloc/jemalloc.h
</filename>></funcsynopsisinfo>
61 <title>Standard API
</title>
63 <funcdef>void *
<function>malloc
</function></funcdef>
64 <paramdef>size_t
<parameter>size
</parameter></paramdef>
67 <funcdef>void *
<function>calloc
</function></funcdef>
68 <paramdef>size_t
<parameter>number
</parameter></paramdef>
69 <paramdef>size_t
<parameter>size
</parameter></paramdef>
72 <funcdef>int
<function>posix_memalign
</function></funcdef>
73 <paramdef>void **
<parameter>ptr
</parameter></paramdef>
74 <paramdef>size_t
<parameter>alignment
</parameter></paramdef>
75 <paramdef>size_t
<parameter>size
</parameter></paramdef>
78 <funcdef>void *
<function>aligned_alloc
</function></funcdef>
79 <paramdef>size_t
<parameter>alignment
</parameter></paramdef>
80 <paramdef>size_t
<parameter>size
</parameter></paramdef>
83 <funcdef>void *
<function>realloc
</function></funcdef>
84 <paramdef>void *
<parameter>ptr
</parameter></paramdef>
85 <paramdef>size_t
<parameter>size
</parameter></paramdef>
88 <funcdef>void
<function>free
</function></funcdef>
89 <paramdef>void *
<parameter>ptr
</parameter></paramdef>
93 <title>Non-standard API
</title>
95 <funcdef>size_t
<function>malloc_usable_size
</function></funcdef>
96 <paramdef>const void *
<parameter>ptr
</parameter></paramdef>
99 <funcdef>void
<function>malloc_stats_print
</function></funcdef>
100 <paramdef>void
<parameter>(*write_cb)
</parameter>
101 <funcparams>void *, const char *
</funcparams>
103 <paramdef>void *
<parameter>cbopaque
</parameter></paramdef>
104 <paramdef>const char *
<parameter>opts
</parameter></paramdef>
107 <funcdef>int
<function>mallctl
</function></funcdef>
108 <paramdef>const char *
<parameter>name
</parameter></paramdef>
109 <paramdef>void *
<parameter>oldp
</parameter></paramdef>
110 <paramdef>size_t *
<parameter>oldlenp
</parameter></paramdef>
111 <paramdef>void *
<parameter>newp
</parameter></paramdef>
112 <paramdef>size_t
<parameter>newlen
</parameter></paramdef>
115 <funcdef>int
<function>mallctlnametomib
</function></funcdef>
116 <paramdef>const char *
<parameter>name
</parameter></paramdef>
117 <paramdef>size_t *
<parameter>mibp
</parameter></paramdef>
118 <paramdef>size_t *
<parameter>miblenp
</parameter></paramdef>
121 <funcdef>int
<function>mallctlbymib
</function></funcdef>
122 <paramdef>const size_t *
<parameter>mib
</parameter></paramdef>
123 <paramdef>size_t
<parameter>miblen
</parameter></paramdef>
124 <paramdef>void *
<parameter>oldp
</parameter></paramdef>
125 <paramdef>size_t *
<parameter>oldlenp
</parameter></paramdef>
126 <paramdef>void *
<parameter>newp
</parameter></paramdef>
127 <paramdef>size_t
<parameter>newlen
</parameter></paramdef>
130 <funcdef>void
<function>(*malloc_message)
</function></funcdef>
131 <paramdef>void *
<parameter>cbopaque
</parameter></paramdef>
132 <paramdef>const char *
<parameter>s
</parameter></paramdef>
134 <para><type>const char *
</type><varname>malloc_conf
</varname>;
</para>
137 <title>Experimental API
</title>
139 <funcdef>int
<function>allocm
</function></funcdef>
140 <paramdef>void **
<parameter>ptr
</parameter></paramdef>
141 <paramdef>size_t *
<parameter>rsize
</parameter></paramdef>
142 <paramdef>size_t
<parameter>size
</parameter></paramdef>
143 <paramdef>int
<parameter>flags
</parameter></paramdef>
146 <funcdef>int
<function>rallocm
</function></funcdef>
147 <paramdef>void **
<parameter>ptr
</parameter></paramdef>
148 <paramdef>size_t *
<parameter>rsize
</parameter></paramdef>
149 <paramdef>size_t
<parameter>size
</parameter></paramdef>
150 <paramdef>size_t
<parameter>extra
</parameter></paramdef>
151 <paramdef>int
<parameter>flags
</parameter></paramdef>
154 <funcdef>int
<function>sallocm
</function></funcdef>
155 <paramdef>const void *
<parameter>ptr
</parameter></paramdef>
156 <paramdef>size_t *
<parameter>rsize
</parameter></paramdef>
157 <paramdef>int
<parameter>flags
</parameter></paramdef>
160 <funcdef>int
<function>dallocm
</function></funcdef>
161 <paramdef>void *
<parameter>ptr
</parameter></paramdef>
162 <paramdef>int
<parameter>flags
</parameter></paramdef>
165 <funcdef>int
<function>nallocm
</function></funcdef>
166 <paramdef>size_t *
<parameter>rsize
</parameter></paramdef>
167 <paramdef>size_t
<parameter>size
</parameter></paramdef>
168 <paramdef>int
<parameter>flags
</parameter></paramdef>
173 <refsect1 id=
"description">
174 <title>DESCRIPTION
</title>
176 <title>Standard API
</title>
178 <para>The
<function>malloc
<parameter/></function> function allocates
179 <parameter>size
</parameter> bytes of uninitialized memory. The allocated
180 space is suitably aligned (after possible pointer coercion) for storage
181 of any type of object.
</para>
183 <para>The
<function>calloc
<parameter/></function> function allocates
184 space for
<parameter>number
</parameter> objects, each
185 <parameter>size
</parameter> bytes in length. The result is identical to
186 calling
<function>malloc
<parameter/></function> with an argument of
187 <parameter>number
</parameter> *
<parameter>size
</parameter>, with the
188 exception that the allocated memory is explicitly initialized to zero
191 <para>The
<function>posix_memalign
<parameter/></function> function
192 allocates
<parameter>size
</parameter> bytes of memory such that the
193 allocation's base address is an even multiple of
194 <parameter>alignment
</parameter>, and returns the allocation in the value
195 pointed to by
<parameter>ptr
</parameter>. The requested
196 <parameter>alignment
</parameter> must be a power of
2 at least as large
197 as
<code language=
"C">sizeof(
<type>void *
</type>)
</code>.
</para>
199 <para>The
<function>aligned_alloc
<parameter/></function> function
200 allocates
<parameter>size
</parameter> bytes of memory such that the
201 allocation's base address is an even multiple of
202 <parameter>alignment
</parameter>. The requested
203 <parameter>alignment
</parameter> must be a power of
2. Behavior is
204 undefined if
<parameter>size
</parameter> is not an integral multiple of
205 <parameter>alignment
</parameter>.
</para>
207 <para>The
<function>realloc
<parameter/></function> function changes the
208 size of the previously allocated memory referenced by
209 <parameter>ptr
</parameter> to
<parameter>size
</parameter> bytes. The
210 contents of the memory are unchanged up to the lesser of the new and old
211 sizes. If the new size is larger, the contents of the newly allocated
212 portion of the memory are undefined. Upon success, the memory referenced
213 by
<parameter>ptr
</parameter> is freed and a pointer to the newly
214 allocated memory is returned. Note that
215 <function>realloc
<parameter/></function> may move the memory allocation,
216 resulting in a different return value than
<parameter>ptr
</parameter>.
217 If
<parameter>ptr
</parameter> is
<constant>NULL
</constant>, the
218 <function>realloc
<parameter/></function> function behaves identically to
219 <function>malloc
<parameter/></function> for the specified size.
</para>
221 <para>The
<function>free
<parameter/></function> function causes the
222 allocated memory referenced by
<parameter>ptr
</parameter> to be made
223 available for future allocations. If
<parameter>ptr
</parameter> is
224 <constant>NULL
</constant>, no action occurs.
</para>
227 <title>Non-standard API
</title>
229 <para>The
<function>malloc_usable_size
<parameter/></function> function
230 returns the usable size of the allocation pointed to by
231 <parameter>ptr
</parameter>. The return value may be larger than the size
232 that was requested during allocation. The
233 <function>malloc_usable_size
<parameter/></function> function is not a
234 mechanism for in-place
<function>realloc
<parameter/></function>; rather
235 it is provided solely as a tool for introspection purposes. Any
236 discrepancy between the requested allocation size and the size reported
237 by
<function>malloc_usable_size
<parameter/></function> should not be
238 depended on, since such behavior is entirely implementation-dependent.
241 <para>The
<function>malloc_stats_print
<parameter/></function> function
242 writes human-readable summary statistics via the
243 <parameter>write_cb
</parameter> callback function pointer and
244 <parameter>cbopaque
</parameter> data passed to
245 <parameter>write_cb
</parameter>, or
246 <function>malloc_message
<parameter/></function> if
247 <parameter>write_cb
</parameter> is
<constant>NULL
</constant>. This
248 function can be called repeatedly. General information that never
249 changes during execution can be omitted by specifying "g" as a character
250 within the
<parameter>opts
</parameter> string. Note that
251 <function>malloc_message
<parameter/></function> uses the
252 <function>mallctl*
<parameter/></function> functions internally, so
253 inconsistent statistics can be reported if multiple threads use these
254 functions simultaneously. If
<option>--enable-stats
</option> is
255 specified during configuration,
“m
” and
“a
” can
256 be specified to omit merged arena and per arena statistics, respectively;
257 “b
” and
“l
” can be specified to omit per size
258 class statistics for bins and large objects, respectively. Unrecognized
259 characters are silently ignored. Note that thread caching may prevent
260 some statistics from being completely up to date, since extra locking
261 would be required to merge counters that track thread cache operations.
264 <para>The
<function>mallctl
<parameter/></function> function provides a
265 general interface for introspecting the memory allocator, as well as
266 setting modifiable parameters and triggering actions. The
267 period-separated
<parameter>name
</parameter> argument specifies a
268 location in a tree-structured namespace; see the
<xref
269 linkend=
"mallctl_namespace" xrefstyle=
"template:%t"/> section for
270 documentation on the tree contents. To read a value, pass a pointer via
271 <parameter>oldp
</parameter> to adequate space to contain the value, and a
272 pointer to its length via
<parameter>oldlenp
</parameter>; otherwise pass
273 <constant>NULL
</constant> and
<constant>NULL
</constant>. Similarly, to
274 write a value, pass a pointer to the value via
275 <parameter>newp
</parameter>, and its length via
276 <parameter>newlen
</parameter>; otherwise pass
<constant>NULL
</constant>
277 and
<constant>0</constant>.
</para>
279 <para>The
<function>mallctlnametomib
<parameter/></function> function
280 provides a way to avoid repeated name lookups for applications that
281 repeatedly query the same portion of the namespace, by translating a name
282 to a
“Management Information Base
” (MIB) that can be passed
283 repeatedly to
<function>mallctlbymib
<parameter/></function>. Upon
284 successful return from
<function>mallctlnametomib
<parameter/></function>,
285 <parameter>mibp
</parameter> contains an array of
286 <parameter>*miblenp
</parameter> integers, where
287 <parameter>*miblenp
</parameter> is the lesser of the number of components
288 in
<parameter>name
</parameter> and the input value of
289 <parameter>*miblenp
</parameter>. Thus it is possible to pass a
290 <parameter>*miblenp
</parameter> that is smaller than the number of
291 period-separated name components, which results in a partial MIB that can
292 be used as the basis for constructing a complete MIB. For name
293 components that are integers (e.g. the
2 in
295 linkend=
"arenas.bin.i.size"><mallctl>arenas.bin
.2.size
</mallctl></link>),
296 the corresponding MIB component will always be that integer. Therefore,
297 it is legitimate to construct code like the following:
<programlisting
298 language=
"C"><![CDATA[
305 mallctl("arenas.nbins", &nbins, &len, NULL,
0);
308 mallnametomib("arenas.bin
.0.size", mib, &miblen);
309 for (i =
0; i < nbins; i++) {
313 len = sizeof(bin_size);
314 mallctlbymib(mib, miblen, &bin_size, &len, NULL,
0);
315 /* Do something with bin_size... */
316 }]]
></programlisting></para>
319 <title>Experimental API
</title>
320 <para>The experimental API is subject to change or removal without regard
321 for backward compatibility. If
<option>--disable-experimental
</option>
322 is specified during configuration, the experimental API is
325 <para>The
<function>allocm
<parameter/></function>,
326 <function>rallocm
<parameter/></function>,
327 <function>sallocm
<parameter/></function>,
328 <function>dallocm
<parameter/></function>, and
329 <function>nallocm
<parameter/></function> functions all have a
330 <parameter>flags
</parameter> argument that can be used to specify
331 options. The functions only check the options that are contextually
332 relevant. Use bitwise or (
<code language=
"C">|
</code>) operations to
333 specify one or more of the following:
336 <term><constant>ALLOCM_LG_ALIGN(
<parameter>la
</parameter>)
339 <listitem><para>Align the memory allocation to start at an address
340 that is a multiple of
<code language=
"C">(
1 <<
341 <parameter>la
</parameter>)
</code>. This macro does not validate
342 that
<parameter>la
</parameter> is within the valid
343 range.
</para></listitem>
346 <term><constant>ALLOCM_ALIGN(
<parameter>a
</parameter>)
349 <listitem><para>Align the memory allocation to start at an address
350 that is a multiple of
<parameter>a
</parameter>, where
351 <parameter>a
</parameter> is a power of two. This macro does not
352 validate that
<parameter>a
</parameter> is a power of
2.
356 <term><constant>ALLOCM_ZERO
</constant></term>
358 <listitem><para>Initialize newly allocated memory to contain zero
359 bytes. In the growing reallocation case, the real size prior to
360 reallocation defines the boundary between untouched bytes and those
361 that are initialized to contain zero bytes. If this option is
362 absent, newly allocated memory is uninitialized.
</para></listitem>
365 <term><constant>ALLOCM_NO_MOVE
</constant></term>
367 <listitem><para>For reallocation, fail rather than moving the
368 object. This constraint can apply to both growth and
369 shrinkage.
</para></listitem>
374 <para>The
<function>allocm
<parameter/></function> function allocates at
375 least
<parameter>size
</parameter> bytes of memory, sets
376 <parameter>*ptr
</parameter> to the base address of the allocation, and
377 sets
<parameter>*rsize
</parameter> to the real size of the allocation if
378 <parameter>rsize
</parameter> is not
<constant>NULL
</constant>. Behavior
379 is undefined if
<parameter>size
</parameter> is
380 <constant>0</constant>.
</para>
382 <para>The
<function>rallocm
<parameter/></function> function resizes the
383 allocation at
<parameter>*ptr
</parameter> to be at least
384 <parameter>size
</parameter> bytes, sets
<parameter>*ptr
</parameter> to
385 the base address of the allocation if it moved, and sets
386 <parameter>*rsize
</parameter> to the real size of the allocation if
387 <parameter>rsize
</parameter> is not
<constant>NULL
</constant>. If
388 <parameter>extra
</parameter> is non-zero, an attempt is made to resize
389 the allocation to be at least
<code
390 language=
"C"><parameter>size
</parameter> +
391 <parameter>extra
</parameter>)
</code> bytes, though inability to allocate
392 the extra byte(s) will not by itself result in failure. Behavior is
393 undefined if
<parameter>size
</parameter> is
<constant>0</constant>, or if
394 <code language=
"C">(
<parameter>size
</parameter> +
395 <parameter>extra
</parameter> >
396 <constant>SIZE_T_MAX
</constant>)
</code>.
</para>
398 <para>The
<function>sallocm
<parameter/></function> function sets
399 <parameter>*rsize
</parameter> to the real size of the allocation.
</para>
401 <para>The
<function>dallocm
<parameter/></function> function causes the
402 memory referenced by
<parameter>ptr
</parameter> to be made available for
403 future allocations.
</para>
405 <para>The
<function>nallocm
<parameter/></function> function allocates no
406 memory, but it performs the same size computation as the
407 <function>allocm
<parameter/></function> function, and if
408 <parameter>rsize
</parameter> is not
<constant>NULL
</constant> it sets
409 <parameter>*rsize
</parameter> to the real size of the allocation that
410 would result from the equivalent
<function>allocm
<parameter/></function>
411 function call. Behavior is undefined if
412 <parameter>size
</parameter> is
<constant>0</constant>.
</para>
415 <refsect1 id=
"tuning">
416 <title>TUNING
</title>
417 <para>Once, when the first call is made to one of the memory allocation
418 routines, the allocator initializes its internals based in part on various
419 options that can be specified at compile- or run-time.
</para>
421 <para>The string pointed to by the global variable
422 <varname>malloc_conf
</varname>, the
“name
” of the file
423 referenced by the symbolic link named
<filename
424 class=
"symlink">/etc/malloc.conf
</filename>, and the value of the
425 environment variable
<envar>MALLOC_CONF
</envar>, will be interpreted, in
426 that order, from left to right as options.
</para>
428 <para>An options string is a comma-separated list of option:value pairs.
429 There is one key corresponding to each
<link
430 linkend=
"opt.abort"><mallctl>opt.*
</mallctl></link> mallctl (see the
<xref
431 linkend=
"mallctl_namespace" xrefstyle=
"template:%t"/> section for options
432 documentation). For example,
<literal>abort:true,narenas:
1</literal> sets
433 the
<link linkend=
"opt.abort"><mallctl>opt.abort
</mallctl></link> and
<link
434 linkend=
"opt.narenas"><mallctl>opt.narenas
</mallctl></link> options. Some
435 options have boolean values (true/false), others have integer values (base
436 8,
10, or
16, depending on prefix), and yet others have raw string
439 <refsect1 id=
"implementation_notes">
440 <title>IMPLEMENTATION NOTES
</title>
441 <para>Traditionally, allocators have used
442 <citerefentry><refentrytitle>sbrk
</refentrytitle>
443 <manvolnum>2</manvolnum></citerefentry> to obtain memory, which is
444 suboptimal for several reasons, including race conditions, increased
445 fragmentation, and artificial limitations on maximum usable memory. If
446 <option>--enable-dss
</option> is specified during configuration, this
447 allocator uses both
<citerefentry><refentrytitle>mmap
</refentrytitle>
448 <manvolnum>2</manvolnum></citerefentry> and
449 <citerefentry><refentrytitle>sbrk
</refentrytitle>
450 <manvolnum>2</manvolnum></citerefentry>, in that order of preference;
451 otherwise only
<citerefentry><refentrytitle>mmap
</refentrytitle>
452 <manvolnum>2</manvolnum></citerefentry> is used.
</para>
454 <para>This allocator uses multiple arenas in order to reduce lock
455 contention for threaded programs on multi-processor systems. This works
456 well with regard to threading scalability, but incurs some costs. There is
457 a small fixed per-arena overhead, and additionally, arenas manage memory
458 completely independently of each other, which means a small fixed increase
459 in overall memory fragmentation. These overheads are not generally an
460 issue, given the number of arenas normally used. Note that using
461 substantially more arenas than the default is not likely to improve
462 performance, mainly due to reduced cache performance. However, it may make
463 sense to reduce the number of arenas if an application does not make much
464 use of the allocation functions.
</para>
466 <para>In addition to multiple arenas, unless
467 <option>--disable-tcache
</option> is specified during configuration, this
468 allocator supports thread-specific caching for small and large objects, in
469 order to make it possible to completely avoid synchronization for most
470 allocation requests. Such caching allows very fast allocation in the
471 common case, but it increases memory usage and fragmentation, since a
472 bounded number of objects can remain allocated in each thread cache.
</para>
474 <para>Memory is conceptually broken into equal-sized chunks, where the
475 chunk size is a power of two that is greater than the page size. Chunks
476 are always aligned to multiples of the chunk size. This alignment makes it
477 possible to find metadata for user objects very quickly.
</para>
479 <para>User objects are broken into three categories according to size:
480 small, large, and huge. Small objects are smaller than one page. Large
481 objects are smaller than the chunk size. Huge objects are a multiple of
482 the chunk size. Small and large objects are managed by arenas; huge
483 objects are managed separately in a single data structure that is shared by
484 all threads. Huge objects are used by applications infrequently enough
485 that this single data structure is not a scalability issue.
</para>
487 <para>Each chunk that is managed by an arena tracks its contents as runs of
488 contiguous pages (unused, backing a set of small objects, or backing one
489 large object). The combination of chunk alignment and chunk page maps
490 makes it possible to determine all metadata regarding small and large
491 allocations in constant time.
</para>
493 <para>Small objects are managed in groups by page runs. Each run maintains
494 a frontier and free list to track which regions are in use. Allocation
495 requests that are no more than half the quantum (
8 or
16, depending on
496 architecture) are rounded up to the nearest power of two that is at least
497 <code language=
"C">sizeof(
<type>double
</type>)
</code>. All other small
498 object size classes are multiples of the quantum, spaced such that internal
499 fragmentation is limited to approximately
25% for all but the smallest size
500 classes. Allocation requests that are larger than the maximum small size
501 class, but small enough to fit in an arena-managed chunk (see the
<link
502 linkend=
"opt.lg_chunk"><mallctl>opt.lg_chunk
</mallctl></link> option), are
503 rounded up to the nearest run size. Allocation requests that are too large
504 to fit in an arena-managed chunk are rounded up to the nearest multiple of
505 the chunk size.
</para>
507 <para>Allocations are packed tightly together, which can be an issue for
508 multi-threaded applications. If you need to assure that allocations do not
509 suffer from cacheline sharing, round your allocation requests up to the
510 nearest multiple of the cacheline size, or specify cacheline alignment when
513 <para>Assuming
4 MiB chunks,
4 KiB pages, and a
16-byte quantum on a
64-bit
514 system, the size classes in each category are as shown in
<xref
515 linkend=
"size_classes" xrefstyle=
"template:Table %n"/>.
</para>
517 <table xml:
id=
"size_classes" frame=
"all">
518 <title>Size classes
</title>
519 <tgroup cols=
"3" colsep=
"1" rowsep=
"1">
520 <colspec colname=
"c1" align=
"left"/>
521 <colspec colname=
"c2" align=
"right"/>
522 <colspec colname=
"c3" align=
"left"/>
525 <entry>Category
</entry>
526 <entry>Spacing
</entry>
532 <entry morerows=
"6">Small
</entry>
538 <entry>[
16,
32,
48, ...,
128]
</entry>
542 <entry>[
160,
192,
224,
256]
</entry>
546 <entry>[
320,
384,
448,
512]
</entry>
550 <entry>[
640,
768,
896,
1024]
</entry>
554 <entry>[
1280,
1536,
1792,
2048]
</entry>
558 <entry>[
2560,
3072,
3584]
</entry>
563 <entry>[
4 KiB,
8 KiB,
12 KiB, ...,
4072 KiB]
</entry>
568 <entry>[
4 MiB,
8 MiB,
12 MiB, ...]
</entry>
574 <refsect1 id=
"mallctl_namespace">
575 <title>MALLCTL NAMESPACE
</title>
576 <para>The following names are defined in the namespace accessible via the
577 <function>mallctl*
<parameter/></function> functions. Value types are
578 specified in parentheses, their readable/writable statuses are encoded as
579 <literal>rw
</literal>,
<literal>r-
</literal>,
<literal>-w
</literal>, or
580 <literal>--
</literal>, and required build configuration flags follow, if
581 any. A name element encoded as
<literal><i
></literal> or
582 <literal><j
></literal> indicates an integer component, where the
583 integer varies from
0 to some upper value that must be determined via
584 introspection. In the case of
<mallctl>stats.arenas.
<i
>.*
</mallctl>,
585 <literal><i
></literal> equal to
<link
586 linkend=
"arenas.narenas"><mallctl>arenas.narenas
</mallctl></link> can be
587 used to access the summation of statistics from all arenas. Take special
588 note of the
<link linkend=
"epoch"><mallctl>epoch
</mallctl></link> mallctl,
589 which controls refreshing of cached dynamic statistics.
</para>
594 <mallctl>version
</mallctl>
595 (
<type>const char *
</type>)
596 <literal>r-
</literal>
598 <listitem><para>Return the jemalloc version string.
</para></listitem>
601 <varlistentry id=
"epoch">
603 <mallctl>epoch
</mallctl>
604 (
<type>uint64_t
</type>)
605 <literal>rw
</literal>
607 <listitem><para>If a value is passed in, refresh the data from which
608 the
<function>mallctl*
<parameter/></function> functions report values,
609 and increment the epoch. Return the current epoch. This is useful for
610 detecting whether another thread caused a refresh.
</para></listitem>
615 <mallctl>config.debug
</mallctl>
617 <literal>r-
</literal>
619 <listitem><para><option>--enable-debug
</option> was specified during
620 build configuration.
</para></listitem>
625 <mallctl>config.dss
</mallctl>
627 <literal>r-
</literal>
629 <listitem><para><option>--enable-dss
</option> was specified during
630 build configuration.
</para></listitem>
635 <mallctl>config.fill
</mallctl>
637 <literal>r-
</literal>
639 <listitem><para><option>--enable-fill
</option> was specified during
640 build configuration.
</para></listitem>
645 <mallctl>config.lazy_lock
</mallctl>
647 <literal>r-
</literal>
649 <listitem><para><option>--enable-lazy-lock
</option> was specified
650 during build configuration.
</para></listitem>
655 <mallctl>config.mremap
</mallctl>
657 <literal>r-
</literal>
659 <listitem><para><option>--enable-mremap
</option> was specified during
660 build configuration.
</para></listitem>
665 <mallctl>config.munmap
</mallctl>
667 <literal>r-
</literal>
669 <listitem><para><option>--enable-munmap
</option> was specified during
670 build configuration.
</para></listitem>
675 <mallctl>config.prof
</mallctl>
677 <literal>r-
</literal>
679 <listitem><para><option>--enable-prof
</option> was specified during
680 build configuration.
</para></listitem>
685 <mallctl>config.prof_libgcc
</mallctl>
687 <literal>r-
</literal>
689 <listitem><para><option>--disable-prof-libgcc
</option> was not
690 specified during build configuration.
</para></listitem>
695 <mallctl>config.prof_libunwind
</mallctl>
697 <literal>r-
</literal>
699 <listitem><para><option>--enable-prof-libunwind
</option> was specified
700 during build configuration.
</para></listitem>
705 <mallctl>config.stats
</mallctl>
707 <literal>r-
</literal>
709 <listitem><para><option>--enable-stats
</option> was specified during
710 build configuration.
</para></listitem>
715 <mallctl>config.tcache
</mallctl>
717 <literal>r-
</literal>
719 <listitem><para><option>--disable-tcache
</option> was not specified
720 during build configuration.
</para></listitem>
725 <mallctl>config.tls
</mallctl>
727 <literal>r-
</literal>
729 <listitem><para><option>--disable-tls
</option> was not specified during
730 build configuration.
</para></listitem>
735 <mallctl>config.utrace
</mallctl>
737 <literal>r-
</literal>
739 <listitem><para><option>--enable-utrace
</option> was specified during
740 build configuration.
</para></listitem>
745 <mallctl>config.valgrind
</mallctl>
747 <literal>r-
</literal>
749 <listitem><para><option>--enable-valgrind
</option> was specified during
750 build configuration.
</para></listitem>
755 <mallctl>config.xmalloc
</mallctl>
757 <literal>r-
</literal>
759 <listitem><para><option>--enable-xmalloc
</option> was specified during
760 build configuration.
</para></listitem>
763 <varlistentry id=
"opt.abort">
765 <mallctl>opt.abort
</mallctl>
767 <literal>r-
</literal>
769 <listitem><para>Abort-on-warning enabled/disabled. If true, most
770 warnings are fatal. The process will call
771 <citerefentry><refentrytitle>abort
</refentrytitle>
772 <manvolnum>3</manvolnum></citerefentry> in these cases. This option is
773 disabled by default unless
<option>--enable-debug
</option> is
774 specified during configuration, in which case it is enabled by default.
778 <varlistentry id=
"opt.lg_chunk">
780 <mallctl>opt.lg_chunk
</mallctl>
781 (
<type>size_t
</type>)
782 <literal>r-
</literal>
784 <listitem><para>Virtual memory chunk size (log base
2). The default
785 chunk size is
4 MiB (
2^
22).
</para></listitem>
788 <varlistentry id=
"opt.narenas">
790 <mallctl>opt.narenas
</mallctl>
791 (
<type>size_t
</type>)
792 <literal>r-
</literal>
794 <listitem><para>Maximum number of arenas to use. The default maximum
795 number of arenas is four times the number of CPUs, or one if there is a
796 single CPU.
</para></listitem>
799 <varlistentry id=
"opt.lg_dirty_mult">
801 <mallctl>opt.lg_dirty_mult
</mallctl>
802 (
<type>ssize_t
</type>)
803 <literal>r-
</literal>
805 <listitem><para>Per-arena minimum ratio (log base
2) of active to dirty
806 pages. Some dirty unused pages may be allowed to accumulate, within
807 the limit set by the ratio (or one chunk worth of dirty pages,
808 whichever is greater), before informing the kernel about some of those
809 pages via
<citerefentry><refentrytitle>madvise
</refentrytitle>
810 <manvolnum>2</manvolnum></citerefentry> or a similar system call. This
811 provides the kernel with sufficient information to recycle dirty pages
812 if physical memory becomes scarce and the pages remain unused. The
813 default minimum ratio is
32:
1 (
2^
5:
1); an option value of -
1 will
814 disable dirty page purging.
</para></listitem>
817 <varlistentry id=
"opt.stats_print">
819 <mallctl>opt.stats_print
</mallctl>
821 <literal>r-
</literal>
823 <listitem><para>Enable/disable statistics printing at exit. If
824 enabled, the
<function>malloc_stats_print
<parameter/></function>
825 function is called at program exit via an
826 <citerefentry><refentrytitle>atexit
</refentrytitle>
827 <manvolnum>3</manvolnum></citerefentry> function. If
828 <option>--enable-stats
</option> is specified during configuration, this
829 has the potential to cause deadlock for a multi-threaded process that
830 exits while one or more threads are executing in the memory allocation
831 functions. Therefore, this option should only be used with care; it is
832 primarily intended as a performance tuning aid during application
833 development. This option is disabled by default.
</para></listitem>
836 <varlistentry id=
"opt.junk">
838 <mallctl>opt.junk
</mallctl>
840 <literal>r-
</literal>
841 [
<option>--enable-fill
</option>]
843 <listitem><para>Junk filling enabled/disabled. If enabled, each byte
844 of uninitialized allocated memory will be initialized to
845 <literal>0xa5</literal>. All deallocated memory will be initialized to
846 <literal>0x5a</literal>. This is intended for debugging and will
847 impact performance negatively. This option is disabled by default
848 unless
<option>--enable-debug
</option> is specified during
849 configuration, in which case it is enabled by default.
</para></listitem>
852 <varlistentry id=
"opt.quarantine">
854 <mallctl>opt.quarantine
</mallctl>
855 (
<type>size_t
</type>)
856 <literal>r-
</literal>
857 [
<option>--enable-fill
</option>]
859 <listitem><para>Per thread quarantine size in bytes. If non-zero, each
860 thread maintains a FIFO object quarantine that stores up to the
861 specified number of bytes of memory. The quarantined memory is not
862 freed until it is released from quarantine, though it is immediately
863 junk-filled if the
<link
864 linkend=
"opt.junk"><mallctl>opt.junk
</mallctl></link> option is
865 enabled. This feature is of particular use in combination with
<ulink
866 url=
"http://valgrind.org/">Valgrind
</ulink>, which can detect attempts
867 to access quarantined objects. This is intended for debugging and will
868 impact performance negatively. The default quarantine size is
872 <varlistentry id=
"opt.redzone">
874 <mallctl>opt.redzone
</mallctl>
876 <literal>r-
</literal>
877 [
<option>--enable-fill
</option>]
879 <listitem><para>Redzones enabled/disabled. If enabled, small
880 allocations have redzones before and after them. Furthermore, if the
881 <link linkend=
"opt.junk"><mallctl>opt.junk
</mallctl></link> option is
882 enabled, the redzones are checked for corruption during deallocation.
883 However, the primary intended purpose of this feature is to be used in
884 combination with
<ulink url=
"http://valgrind.org/">Valgrind
</ulink>,
885 which needs redzones in order to do effective buffer overflow/underflow
886 detection. This option is intended for debugging and will impact
887 performance negatively. This option is disabled by
888 default.
</para></listitem>
891 <varlistentry id=
"opt.zero">
893 <mallctl>opt.zero
</mallctl>
895 <literal>r-
</literal>
896 [
<option>--enable-fill
</option>]
898 <listitem><para>Zero filling enabled/disabled. If enabled, each byte
899 of uninitialized allocated memory will be initialized to
0. Note that
900 this initialization only happens once for each byte, so
901 <function>realloc
<parameter/></function> and
902 <function>rallocm
<parameter/></function> calls do not zero memory that
903 was previously allocated. This is intended for debugging and will
904 impact performance negatively. This option is disabled by default.
908 <varlistentry id=
"opt.utrace">
910 <mallctl>opt.utrace
</mallctl>
912 <literal>r-
</literal>
913 [
<option>--enable-utrace
</option>]
915 <listitem><para>Allocation tracing based on
916 <citerefentry><refentrytitle>utrace
</refentrytitle>
917 <manvolnum>2</manvolnum></citerefentry> enabled/disabled. This option
918 is disabled by default.
</para></listitem>
921 <varlistentry id=
"opt.valgrind">
923 <mallctl>opt.valgrind
</mallctl>
925 <literal>r-
</literal>
926 [
<option>--enable-valgrind
</option>]
928 <listitem><para><ulink url=
"http://valgrind.org/">Valgrind
</ulink>
929 support enabled/disabled. If enabled, several other options are
930 automatically modified during options processing to work well with
931 Valgrind:
<link linkend=
"opt.junk"><mallctl>opt.junk
</mallctl></link>
932 and
<link linkend=
"opt.zero"><mallctl>opt.zero
</mallctl></link> are set
934 linkend=
"opt.quarantine"><mallctl>opt.quarantine
</mallctl></link> is
935 set to
16 MiB, and
<link
936 linkend=
"opt.redzone"><mallctl>opt.redzone
</mallctl></link> is set to
937 true. This option is disabled by default.
</para></listitem>
940 <varlistentry id=
"opt.xmalloc">
942 <mallctl>opt.xmalloc
</mallctl>
944 <literal>r-
</literal>
945 [
<option>--enable-xmalloc
</option>]
947 <listitem><para>Abort-on-out-of-memory enabled/disabled. If enabled,
948 rather than returning failure for any allocation function, display a
949 diagnostic message on
<constant>STDERR_FILENO
</constant> and cause the
950 program to drop core (using
951 <citerefentry><refentrytitle>abort
</refentrytitle>
952 <manvolnum>3</manvolnum></citerefentry>). If an application is
953 designed to depend on this behavior, set the option at compile time by
954 including the following in the source code:
955 <programlisting language=
"C"><![CDATA[
956 malloc_conf = "xmalloc:true";]]
></programlisting>
957 This option is disabled by default.
</para></listitem>
960 <varlistentry id=
"opt.tcache">
962 <mallctl>opt.tcache
</mallctl>
964 <literal>r-
</literal>
965 [
<option>--enable-tcache
</option>]
967 <listitem><para>Thread-specific caching enabled/disabled. When there
968 are multiple threads, each thread uses a thread-specific cache for
969 objects up to a certain size. Thread-specific caching allows many
970 allocations to be satisfied without performing any thread
971 synchronization, at the cost of increased memory use. See the
973 linkend=
"opt.lg_tcache_max"><mallctl>opt.lg_tcache_max
</mallctl></link>
974 option for related tuning information. This option is enabled by
975 default.
</para></listitem>
978 <varlistentry id=
"opt.lg_tcache_max">
980 <mallctl>opt.lg_tcache_max
</mallctl>
981 (
<type>size_t
</type>)
982 <literal>r-
</literal>
983 [
<option>--enable-tcache
</option>]
985 <listitem><para>Maximum size class (log base
2) to cache in the
986 thread-specific cache. At a minimum, all small size classes are
987 cached, and at a maximum all large size classes are cached. The
988 default maximum is
32 KiB (
2^
15).
</para></listitem>
991 <varlistentry id=
"opt.prof">
993 <mallctl>opt.prof
</mallctl>
995 <literal>r-
</literal>
996 [
<option>--enable-prof
</option>]
998 <listitem><para>Memory profiling enabled/disabled. If enabled, profile
999 memory allocation activity. See the
<link
1000 linkend=
"opt.prof_active"><mallctl>opt.prof_active
</mallctl></link>
1001 option for on-the-fly activation/deactivation. See the
<link
1002 linkend=
"opt.lg_prof_sample"><mallctl>opt.lg_prof_sample
</mallctl></link>
1003 option for probabilistic sampling control. See the
<link
1004 linkend=
"opt.prof_accum"><mallctl>opt.prof_accum
</mallctl></link>
1005 option for control of cumulative sample reporting. See the
<link
1006 linkend=
"opt.lg_prof_interval"><mallctl>opt.lg_prof_interval
</mallctl></link>
1007 option for information on interval-triggered profile dumping, the
<link
1008 linkend=
"opt.prof_gdump"><mallctl>opt.prof_gdump
</mallctl></link>
1009 option for information on high-water-triggered profile dumping, and the
1010 <link linkend=
"opt.prof_final"><mallctl>opt.prof_final
</mallctl></link>
1011 option for final profile dumping. Profile output is compatible with
1012 the included
<command>pprof
</command> Perl script, which originates
1013 from the
<ulink url=
"http://code.google.com/p/gperftools/">gperftools
1014 package
</ulink>.
</para></listitem>
1017 <varlistentry id=
"opt.prof_prefix">
1019 <mallctl>opt.prof_prefix
</mallctl>
1020 (
<type>const char *
</type>)
1021 <literal>r-
</literal>
1022 [
<option>--enable-prof
</option>]
1024 <listitem><para>Filename prefix for profile dumps. If the prefix is
1025 set to the empty string, no automatic dumps will occur; this is
1026 primarily useful for disabling the automatic final heap dump (which
1027 also disables leak reporting, if enabled). The default prefix is
1028 <filename>jeprof
</filename>.
</para></listitem>
1031 <varlistentry id=
"opt.prof_active">
1033 <mallctl>opt.prof_active
</mallctl>
1035 <literal>r-
</literal>
1036 [
<option>--enable-prof
</option>]
1038 <listitem><para>Profiling activated/deactivated. This is a secondary
1039 control mechanism that makes it possible to start the application with
1040 profiling enabled (see the
<link
1041 linkend=
"opt.prof"><mallctl>opt.prof
</mallctl></link> option) but
1042 inactive, then toggle profiling at any time during program execution
1044 linkend=
"prof.active"><mallctl>prof.active
</mallctl></link> mallctl.
1045 This option is enabled by default.
</para></listitem>
1048 <varlistentry id=
"opt.lg_prof_sample">
1050 <mallctl>opt.lg_prof_sample
</mallctl>
1051 (
<type>ssize_t
</type>)
1052 <literal>r-
</literal>
1053 [
<option>--enable-prof
</option>]
1055 <listitem><para>Average interval (log base
2) between allocation
1056 samples, as measured in bytes of allocation activity. Increasing the
1057 sampling interval decreases profile fidelity, but also decreases the
1058 computational overhead. The default sample interval is
512 KiB (
2^
19
1059 B).
</para></listitem>
1062 <varlistentry id=
"opt.prof_accum">
1064 <mallctl>opt.prof_accum
</mallctl>
1066 <literal>r-
</literal>
1067 [
<option>--enable-prof
</option>]
1069 <listitem><para>Reporting of cumulative object/byte counts in profile
1070 dumps enabled/disabled. If this option is enabled, every unique
1071 backtrace must be stored for the duration of execution. Depending on
1072 the application, this can impose a large memory overhead, and the
1073 cumulative counts are not always of interest. This option is disabled
1074 by default.
</para></listitem>
1077 <varlistentry id=
"opt.lg_prof_interval">
1079 <mallctl>opt.lg_prof_interval
</mallctl>
1080 (
<type>ssize_t
</type>)
1081 <literal>r-
</literal>
1082 [
<option>--enable-prof
</option>]
1084 <listitem><para>Average interval (log base
2) between memory profile
1085 dumps, as measured in bytes of allocation activity. The actual
1086 interval between dumps may be sporadic because decentralized allocation
1087 counters are used to avoid synchronization bottlenecks. Profiles are
1088 dumped to files named according to the pattern
1089 <filename><prefix
>.
<pid
>.
<seq
>.i
<iseq
>.heap
</filename>,
1090 where
<literal><prefix
></literal> is controlled by the
1092 linkend=
"opt.prof_prefix"><mallctl>opt.prof_prefix
</mallctl></link>
1093 option. By default, interval-triggered profile dumping is disabled
1098 <varlistentry id=
"opt.prof_gdump">
1100 <mallctl>opt.prof_gdump
</mallctl>
1102 <literal>r-
</literal>
1103 [
<option>--enable-prof
</option>]
1105 <listitem><para>Trigger a memory profile dump every time the total
1106 virtual memory exceeds the previous maximum. Profiles are dumped to
1107 files named according to the pattern
1108 <filename><prefix
>.
<pid
>.
<seq
>.u
<useq
>.heap
</filename>,
1109 where
<literal><prefix
></literal> is controlled by the
<link
1110 linkend=
"opt.prof_prefix"><mallctl>opt.prof_prefix
</mallctl></link>
1111 option. This option is disabled by default.
</para></listitem>
1114 <varlistentry id=
"opt.prof_final">
1116 <mallctl>opt.prof_final
</mallctl>
1118 <literal>r-
</literal>
1119 [
<option>--enable-prof
</option>]
1121 <listitem><para>Use an
1122 <citerefentry><refentrytitle>atexit
</refentrytitle>
1123 <manvolnum>3</manvolnum></citerefentry> function to dump final memory
1124 usage to a file named according to the pattern
1125 <filename><prefix
>.
<pid
>.
<seq
>.f.heap
</filename>,
1126 where
<literal><prefix
></literal> is controlled by the
<link
1127 linkend=
"opt.prof_prefix"><mallctl>opt.prof_prefix
</mallctl></link>
1128 option. This option is enabled by default.
</para></listitem>
1131 <varlistentry id=
"opt.prof_leak">
1133 <mallctl>opt.prof_leak
</mallctl>
1135 <literal>r-
</literal>
1136 [
<option>--enable-prof
</option>]
1138 <listitem><para>Leak reporting enabled/disabled. If enabled, use an
1139 <citerefentry><refentrytitle>atexit
</refentrytitle>
1140 <manvolnum>3</manvolnum></citerefentry> function to report memory leaks
1141 detected by allocation sampling. See the
1142 <link linkend=
"opt.prof"><mallctl>opt.prof
</mallctl></link> option for
1143 information on analyzing heap profile output. This option is disabled
1144 by default.
</para></listitem>
1149 <mallctl>thread.arena
</mallctl>
1150 (
<type>unsigned
</type>)
1151 <literal>rw
</literal>
1153 <listitem><para>Get or set the arena associated with the calling
1154 thread. The arena index must be less than the maximum number of arenas
1156 linkend=
"arenas.narenas"><mallctl>arenas.narenas
</mallctl></link>
1157 mallctl). If the specified arena was not initialized beforehand (see
1159 linkend=
"arenas.initialized"><mallctl>arenas.initialized
</mallctl></link>
1160 mallctl), it will be automatically initialized as a side effect of
1161 calling this interface.
</para></listitem>
1164 <varlistentry id=
"thread.allocated">
1166 <mallctl>thread.allocated
</mallctl>
1167 (
<type>uint64_t
</type>)
1168 <literal>r-
</literal>
1169 [
<option>--enable-stats
</option>]
1171 <listitem><para>Get the total number of bytes ever allocated by the
1172 calling thread. This counter has the potential to wrap around; it is
1173 up to the application to appropriately interpret the counter in such
1174 cases.
</para></listitem>
1179 <mallctl>thread.allocatedp
</mallctl>
1180 (
<type>uint64_t *
</type>)
1181 <literal>r-
</literal>
1182 [
<option>--enable-stats
</option>]
1184 <listitem><para>Get a pointer to the the value that is returned by the
1186 linkend=
"thread.allocated"><mallctl>thread.allocated
</mallctl></link>
1187 mallctl. This is useful for avoiding the overhead of repeated
1188 <function>mallctl*
<parameter/></function> calls.
</para></listitem>
1191 <varlistentry id=
"thread.deallocated">
1193 <mallctl>thread.deallocated
</mallctl>
1194 (
<type>uint64_t
</type>)
1195 <literal>r-
</literal>
1196 [
<option>--enable-stats
</option>]
1198 <listitem><para>Get the total number of bytes ever deallocated by the
1199 calling thread. This counter has the potential to wrap around; it is
1200 up to the application to appropriately interpret the counter in such
1201 cases.
</para></listitem>
1206 <mallctl>thread.deallocatedp
</mallctl>
1207 (
<type>uint64_t *
</type>)
1208 <literal>r-
</literal>
1209 [
<option>--enable-stats
</option>]
1211 <listitem><para>Get a pointer to the the value that is returned by the
1213 linkend=
"thread.deallocated"><mallctl>thread.deallocated
</mallctl></link>
1214 mallctl. This is useful for avoiding the overhead of repeated
1215 <function>mallctl*
<parameter/></function> calls.
</para></listitem>
1220 <mallctl>thread.tcache.enabled
</mallctl>
1222 <literal>rw
</literal>
1223 [
<option>--enable-tcache
</option>]
1225 <listitem><para>Enable/disable calling thread's tcache. The tcache is
1226 implicitly flushed as a side effect of becoming
1228 lenkend=
"thread.tcache.flush"><mallctl>thread.tcache.flush
</mallctl></link>).
1234 <mallctl>thread.tcache.flush
</mallctl>
1236 <literal>--
</literal>
1237 [
<option>--enable-tcache
</option>]
1239 <listitem><para>Flush calling thread's tcache. This interface releases
1240 all cached objects and internal data structures associated with the
1241 calling thread's thread-specific cache. Ordinarily, this interface
1242 need not be called, since automatic periodic incremental garbage
1243 collection occurs, and the thread cache is automatically discarded when
1244 a thread exits. However, garbage collection is triggered by allocation
1245 activity, so it is possible for a thread that stops
1246 allocating/deallocating to retain its cache indefinitely, in which case
1247 the developer may find manual flushing useful.
</para></listitem>
1250 <varlistentry id=
"arenas.narenas">
1252 <mallctl>arenas.narenas
</mallctl>
1253 (
<type>unsigned
</type>)
1254 <literal>r-
</literal>
1256 <listitem><para>Maximum number of arenas.
</para></listitem>
1259 <varlistentry id=
"arenas.initialized">
1261 <mallctl>arenas.initialized
</mallctl>
1262 (
<type>bool *
</type>)
1263 <literal>r-
</literal>
1265 <listitem><para>An array of
<link
1266 linkend=
"arenas.narenas"><mallctl>arenas.narenas
</mallctl></link>
1267 booleans. Each boolean indicates whether the corresponding arena is
1268 initialized.
</para></listitem>
1273 <mallctl>arenas.quantum
</mallctl>
1274 (
<type>size_t
</type>)
1275 <literal>r-
</literal>
1277 <listitem><para>Quantum size.
</para></listitem>
1282 <mallctl>arenas.page
</mallctl>
1283 (
<type>size_t
</type>)
1284 <literal>r-
</literal>
1286 <listitem><para>Page size.
</para></listitem>
1291 <mallctl>arenas.tcache_max
</mallctl>
1292 (
<type>size_t
</type>)
1293 <literal>r-
</literal>
1294 [
<option>--enable-tcache
</option>]
1296 <listitem><para>Maximum thread-cached size class.
</para></listitem>
1301 <mallctl>arenas.nbins
</mallctl>
1302 (
<type>unsigned
</type>)
1303 <literal>r-
</literal>
1305 <listitem><para>Number of bin size classes.
</para></listitem>
1310 <mallctl>arenas.nhbins
</mallctl>
1311 (
<type>unsigned
</type>)
1312 <literal>r-
</literal>
1313 [
<option>--enable-tcache
</option>]
1315 <listitem><para>Total number of thread cache bin size
1316 classes.
</para></listitem>
1319 <varlistentry id=
"arenas.bin.i.size">
1321 <mallctl>arenas.bin.
<i
>.size
</mallctl>
1322 (
<type>size_t
</type>)
1323 <literal>r-
</literal>
1325 <listitem><para>Maximum size supported by size class.
</para></listitem>
1330 <mallctl>arenas.bin.
<i
>.nregs
</mallctl>
1331 (
<type>uint32_t
</type>)
1332 <literal>r-
</literal>
1334 <listitem><para>Number of regions per page run.
</para></listitem>
1339 <mallctl>arenas.bin.
<i
>.run_size
</mallctl>
1340 (
<type>size_t
</type>)
1341 <literal>r-
</literal>
1343 <listitem><para>Number of bytes per page run.
</para></listitem>
1348 <mallctl>arenas.nlruns
</mallctl>
1349 (
<type>size_t
</type>)
1350 <literal>r-
</literal>
1352 <listitem><para>Total number of large size classes.
</para></listitem>
1357 <mallctl>arenas.lrun.
<i
>.size
</mallctl>
1358 (
<type>size_t
</type>)
1359 <literal>r-
</literal>
1361 <listitem><para>Maximum size supported by this large size
1362 class.
</para></listitem>
1367 <mallctl>arenas.purge
</mallctl>
1368 (
<type>unsigned
</type>)
1369 <literal>-w
</literal>
1371 <listitem><para>Purge unused dirty pages for the specified arena, or
1372 for all arenas if none is specified.
</para></listitem>
1375 <varlistentry id=
"prof.active">
1377 <mallctl>prof.active
</mallctl>
1379 <literal>rw
</literal>
1380 [
<option>--enable-prof
</option>]
1382 <listitem><para>Control whether sampling is currently active. See the
1384 linkend=
"opt.prof_active"><mallctl>opt.prof_active
</mallctl></link>
1385 option for additional information.
1391 <mallctl>prof.dump
</mallctl>
1392 (
<type>const char *
</type>)
1393 <literal>-w
</literal>
1394 [
<option>--enable-prof
</option>]
1396 <listitem><para>Dump a memory profile to the specified file, or if NULL
1397 is specified, to a file according to the pattern
1398 <filename><prefix
>.
<pid
>.
<seq
>.m
<mseq
>.heap
</filename>,
1399 where
<literal><prefix
></literal> is controlled by the
1401 linkend=
"opt.prof_prefix"><mallctl>opt.prof_prefix
</mallctl></link>
1402 option.
</para></listitem>
1407 <mallctl>prof.interval
</mallctl>
1408 (
<type>uint64_t
</type>)
1409 <literal>r-
</literal>
1410 [
<option>--enable-prof
</option>]
1412 <listitem><para>Average number of bytes allocated between
1413 inverval-based profile dumps. See the
1415 linkend=
"opt.lg_prof_interval"><mallctl>opt.lg_prof_interval
</mallctl></link>
1416 option for additional information.
</para></listitem>
1419 <varlistentry id=
"stats.cactive">
1421 <mallctl>stats.cactive
</mallctl>
1422 (
<type>size_t *
</type>)
1423 <literal>r-
</literal>
1424 [
<option>--enable-stats
</option>]
1426 <listitem><para>Pointer to a counter that contains an approximate count
1427 of the current number of bytes in active pages. The estimate may be
1428 high, but never low, because each arena rounds up to the nearest
1429 multiple of the chunk size when computing its contribution to the
1430 counter. Note that the
<link
1431 linkend=
"epoch"><mallctl>epoch
</mallctl></link> mallctl has no bearing
1432 on this counter. Furthermore, counter consistency is maintained via
1433 atomic operations, so it is necessary to use an atomic operation in
1434 order to guarantee a consistent read when dereferencing the pointer.
1438 <varlistentry id=
"stats.allocated">
1440 <mallctl>stats.allocated
</mallctl>
1441 (
<type>size_t
</type>)
1442 <literal>r-
</literal>
1443 [
<option>--enable-stats
</option>]
1445 <listitem><para>Total number of bytes allocated by the
1446 application.
</para></listitem>
1449 <varlistentry id=
"stats.active">
1451 <mallctl>stats.active
</mallctl>
1452 (
<type>size_t
</type>)
1453 <literal>r-
</literal>
1454 [
<option>--enable-stats
</option>]
1456 <listitem><para>Total number of bytes in active pages allocated by the
1457 application. This is a multiple of the page size, and greater than or
1459 linkend=
"stats.allocated"><mallctl>stats.allocated
</mallctl></link>.
1465 <mallctl>stats.mapped
</mallctl>
1466 (
<type>size_t
</type>)
1467 <literal>r-
</literal>
1468 [
<option>--enable-stats
</option>]
1470 <listitem><para>Total number of bytes in chunks mapped on behalf of the
1471 application. This is a multiple of the chunk size, and is at least as
1473 linkend=
"stats.active"><mallctl>stats.active
</mallctl></link>. This
1474 does not include inactive chunks.
</para></listitem>
1479 <mallctl>stats.chunks.current
</mallctl>
1480 (
<type>size_t
</type>)
1481 <literal>r-
</literal>
1482 [
<option>--enable-stats
</option>]
1484 <listitem><para>Total number of chunks actively mapped on behalf of the
1485 application. This does not include inactive chunks.
1491 <mallctl>stats.chunks.total
</mallctl>
1492 (
<type>uint64_t
</type>)
1493 <literal>r-
</literal>
1494 [
<option>--enable-stats
</option>]
1496 <listitem><para>Cumulative number of chunks allocated.
</para></listitem>
1501 <mallctl>stats.chunks.high
</mallctl>
1502 (
<type>size_t
</type>)
1503 <literal>r-
</literal>
1504 [
<option>--enable-stats
</option>]
1506 <listitem><para>Maximum number of active chunks at any time thus far.
1512 <mallctl>stats.huge.allocated
</mallctl>
1513 (
<type>size_t
</type>)
1514 <literal>r-
</literal>
1515 [
<option>--enable-stats
</option>]
1517 <listitem><para>Number of bytes currently allocated by huge objects.
1523 <mallctl>stats.huge.nmalloc
</mallctl>
1524 (
<type>uint64_t
</type>)
1525 <literal>r-
</literal>
1526 [
<option>--enable-stats
</option>]
1528 <listitem><para>Cumulative number of huge allocation requests.
1534 <mallctl>stats.huge.ndalloc
</mallctl>
1535 (
<type>uint64_t
</type>)
1536 <literal>r-
</literal>
1537 [
<option>--enable-stats
</option>]
1539 <listitem><para>Cumulative number of huge deallocation requests.
1545 <mallctl>stats.arenas.
<i
>.nthreads
</mallctl>
1546 (
<type>unsigned
</type>)
1547 <literal>r-
</literal>
1549 <listitem><para>Number of threads currently assigned to
1550 arena.
</para></listitem>
1555 <mallctl>stats.arenas.
<i
>.pactive
</mallctl>
1556 (
<type>size_t
</type>)
1557 <literal>r-
</literal>
1559 <listitem><para>Number of pages in active runs.
</para></listitem>
1564 <mallctl>stats.arenas.
<i
>.pdirty
</mallctl>
1565 (
<type>size_t
</type>)
1566 <literal>r-
</literal>
1568 <listitem><para>Number of pages within unused runs that are potentially
1569 dirty, and for which
<function>madvise
<parameter>...
</parameter>
1570 <parameter><constant>MADV_DONTNEED
</constant></parameter></function> or
1571 similar has not been called.
</para></listitem>
1576 <mallctl>stats.arenas.
<i
>.mapped
</mallctl>
1577 (
<type>size_t
</type>)
1578 <literal>r-
</literal>
1579 [
<option>--enable-stats
</option>]
1581 <listitem><para>Number of mapped bytes.
</para></listitem>
1586 <mallctl>stats.arenas.
<i
>.npurge
</mallctl>
1587 (
<type>uint64_t
</type>)
1588 <literal>r-
</literal>
1589 [
<option>--enable-stats
</option>]
1591 <listitem><para>Number of dirty page purge sweeps performed.
1597 <mallctl>stats.arenas.
<i
>.nmadvise
</mallctl>
1598 (
<type>uint64_t
</type>)
1599 <literal>r-
</literal>
1600 [
<option>--enable-stats
</option>]
1602 <listitem><para>Number of
<function>madvise
<parameter>...
</parameter>
1603 <parameter><constant>MADV_DONTNEED
</constant></parameter></function> or
1604 similar calls made to purge dirty pages.
</para></listitem>
1609 <mallctl>stats.arenas.
<i
>.npurged
</mallctl>
1610 (
<type>uint64_t
</type>)
1611 <literal>r-
</literal>
1612 [
<option>--enable-stats
</option>]
1614 <listitem><para>Number of pages purged.
</para></listitem>
1619 <mallctl>stats.arenas.
<i
>.small.allocated
</mallctl>
1620 (
<type>size_t
</type>)
1621 <literal>r-
</literal>
1622 [
<option>--enable-stats
</option>]
1624 <listitem><para>Number of bytes currently allocated by small objects.
1630 <mallctl>stats.arenas.
<i
>.small.nmalloc
</mallctl>
1631 (
<type>uint64_t
</type>)
1632 <literal>r-
</literal>
1633 [
<option>--enable-stats
</option>]
1635 <listitem><para>Cumulative number of allocation requests served by
1636 small bins.
</para></listitem>
1641 <mallctl>stats.arenas.
<i
>.small.ndalloc
</mallctl>
1642 (
<type>uint64_t
</type>)
1643 <literal>r-
</literal>
1644 [
<option>--enable-stats
</option>]
1646 <listitem><para>Cumulative number of small objects returned to bins.
1652 <mallctl>stats.arenas.
<i
>.small.nrequests
</mallctl>
1653 (
<type>uint64_t
</type>)
1654 <literal>r-
</literal>
1655 [
<option>--enable-stats
</option>]
1657 <listitem><para>Cumulative number of small allocation requests.
1663 <mallctl>stats.arenas.
<i
>.large.allocated
</mallctl>
1664 (
<type>size_t
</type>)
1665 <literal>r-
</literal>
1666 [
<option>--enable-stats
</option>]
1668 <listitem><para>Number of bytes currently allocated by large objects.
1674 <mallctl>stats.arenas.
<i
>.large.nmalloc
</mallctl>
1675 (
<type>uint64_t
</type>)
1676 <literal>r-
</literal>
1677 [
<option>--enable-stats
</option>]
1679 <listitem><para>Cumulative number of large allocation requests served
1680 directly by the arena.
</para></listitem>
1685 <mallctl>stats.arenas.
<i
>.large.ndalloc
</mallctl>
1686 (
<type>uint64_t
</type>)
1687 <literal>r-
</literal>
1688 [
<option>--enable-stats
</option>]
1690 <listitem><para>Cumulative number of large deallocation requests served
1691 directly by the arena.
</para></listitem>
1696 <mallctl>stats.arenas.
<i
>.large.nrequests
</mallctl>
1697 (
<type>uint64_t
</type>)
1698 <literal>r-
</literal>
1699 [
<option>--enable-stats
</option>]
1701 <listitem><para>Cumulative number of large allocation requests.
1707 <mallctl>stats.arenas.
<i
>.bins.
<j
>.allocated
</mallctl>
1708 (
<type>size_t
</type>)
1709 <literal>r-
</literal>
1710 [
<option>--enable-stats
</option>]
1712 <listitem><para>Current number of bytes allocated by
1713 bin.
</para></listitem>
1718 <mallctl>stats.arenas.
<i
>.bins.
<j
>.nmalloc
</mallctl>
1719 (
<type>uint64_t
</type>)
1720 <literal>r-
</literal>
1721 [
<option>--enable-stats
</option>]
1723 <listitem><para>Cumulative number of allocations served by bin.
1729 <mallctl>stats.arenas.
<i
>.bins.
<j
>.ndalloc
</mallctl>
1730 (
<type>uint64_t
</type>)
1731 <literal>r-
</literal>
1732 [
<option>--enable-stats
</option>]
1734 <listitem><para>Cumulative number of allocations returned to bin.
1740 <mallctl>stats.arenas.
<i
>.bins.
<j
>.nrequests
</mallctl>
1741 (
<type>uint64_t
</type>)
1742 <literal>r-
</literal>
1743 [
<option>--enable-stats
</option>]
1745 <listitem><para>Cumulative number of allocation
1746 requests.
</para></listitem>
1751 <mallctl>stats.arenas.
<i
>.bins.
<j
>.nfills
</mallctl>
1752 (
<type>uint64_t
</type>)
1753 <literal>r-
</literal>
1754 [
<option>--enable-stats
</option> <option>--enable-tcache
</option>]
1756 <listitem><para>Cumulative number of tcache fills.
</para></listitem>
1761 <mallctl>stats.arenas.
<i
>.bins.
<j
>.nflushes
</mallctl>
1762 (
<type>uint64_t
</type>)
1763 <literal>r-
</literal>
1764 [
<option>--enable-stats
</option> <option>--enable-tcache
</option>]
1766 <listitem><para>Cumulative number of tcache flushes.
</para></listitem>
1771 <mallctl>stats.arenas.
<i
>.bins.
<j
>.nruns
</mallctl>
1772 (
<type>uint64_t
</type>)
1773 <literal>r-
</literal>
1774 [
<option>--enable-stats
</option>]
1776 <listitem><para>Cumulative number of runs created.
</para></listitem>
1781 <mallctl>stats.arenas.
<i
>.bins.
<j
>.nreruns
</mallctl>
1782 (
<type>uint64_t
</type>)
1783 <literal>r-
</literal>
1784 [
<option>--enable-stats
</option>]
1786 <listitem><para>Cumulative number of times the current run from which
1787 to allocate changed.
</para></listitem>
1792 <mallctl>stats.arenas.
<i
>.bins.
<j
>.curruns
</mallctl>
1793 (
<type>size_t
</type>)
1794 <literal>r-
</literal>
1795 [
<option>--enable-stats
</option>]
1797 <listitem><para>Current number of runs.
</para></listitem>
1802 <mallctl>stats.arenas.
<i
>.lruns.
<j
>.nmalloc
</mallctl>
1803 (
<type>uint64_t
</type>)
1804 <literal>r-
</literal>
1805 [
<option>--enable-stats
</option>]
1807 <listitem><para>Cumulative number of allocation requests for this size
1808 class served directly by the arena.
</para></listitem>
1813 <mallctl>stats.arenas.
<i
>.lruns.
<j
>.ndalloc
</mallctl>
1814 (
<type>uint64_t
</type>)
1815 <literal>r-
</literal>
1816 [
<option>--enable-stats
</option>]
1818 <listitem><para>Cumulative number of deallocation requests for this
1819 size class served directly by the arena.
</para></listitem>
1824 <mallctl>stats.arenas.
<i
>.lruns.
<j
>.nrequests
</mallctl>
1825 (
<type>uint64_t
</type>)
1826 <literal>r-
</literal>
1827 [
<option>--enable-stats
</option>]
1829 <listitem><para>Cumulative number of allocation requests for this size
1830 class.
</para></listitem>
1835 <mallctl>stats.arenas.
<i
>.lruns.
<j
>.curruns
</mallctl>
1836 (
<type>size_t
</type>)
1837 <literal>r-
</literal>
1838 [
<option>--enable-stats
</option>]
1840 <listitem><para>Current number of runs for this size class.
1845 <refsect1 id=
"debugging_malloc_problems">
1846 <title>DEBUGGING MALLOC PROBLEMS
</title>
1847 <para>When debugging, it is a good idea to configure/build jemalloc with
1848 the
<option>--enable-debug
</option> and
<option>--enable-fill
</option>
1849 options, and recompile the program with suitable options and symbols for
1850 debugger support. When so configured, jemalloc incorporates a wide variety
1851 of run-time assertions that catch application errors such as double-free,
1852 write-after-free, etc.
</para>
1854 <para>Programs often accidentally depend on
“uninitialized
”
1855 memory actually being filled with zero bytes. Junk filling
1856 (see the
<link linkend=
"opt.junk"><mallctl>opt.junk
</mallctl></link>
1857 option) tends to expose such bugs in the form of obviously incorrect
1858 results and/or coredumps. Conversely, zero
1859 filling (see the
<link
1860 linkend=
"opt.zero"><mallctl>opt.zero
</mallctl></link> option) eliminates
1861 the symptoms of such bugs. Between these two options, it is usually
1862 possible to quickly detect, diagnose, and eliminate such bugs.
</para>
1864 <para>This implementation does not provide much detail about the problems
1865 it detects, because the performance impact for storing such information
1866 would be prohibitive. However, jemalloc does integrate with the most
1867 excellent
<ulink url=
"http://valgrind.org/">Valgrind
</ulink> tool if the
1868 <option>--enable-valgrind
</option> configuration option is enabled and the
1869 <link linkend=
"opt.valgrind"><mallctl>opt.valgrind
</mallctl></link> option
1872 <refsect1 id=
"diagnostic_messages">
1873 <title>DIAGNOSTIC MESSAGES
</title>
1874 <para>If any of the memory allocation/deallocation functions detect an
1875 error or warning condition, a message will be printed to file descriptor
1876 <constant>STDERR_FILENO
</constant>. Errors will result in the process
1877 dumping core. If the
<link
1878 linkend=
"opt.abort"><mallctl>opt.abort
</mallctl></link> option is set, most
1879 warnings are treated as errors.
</para>
1881 <para>The
<varname>malloc_message
</varname> variable allows the programmer
1882 to override the function which emits the text strings forming the errors
1883 and warnings if for some reason the
<constant>STDERR_FILENO
</constant> file
1884 descriptor is not suitable for this.
1885 <function>malloc_message
<parameter/></function> takes the
1886 <parameter>cbopaque
</parameter> pointer argument that is
1887 <constant>NULL
</constant> unless overridden by the arguments in a call to
1888 <function>malloc_stats_print
<parameter/></function>, followed by a string
1889 pointer. Please note that doing anything which tries to allocate memory in
1890 this function is likely to result in a crash or deadlock.
</para>
1892 <para>All messages are prefixed by
1893 “<computeroutput><jemalloc
>:
</computeroutput>”.
</para>
1895 <refsect1 id=
"return_values">
1896 <title>RETURN VALUES
</title>
1898 <title>Standard API
</title>
1899 <para>The
<function>malloc
<parameter/></function> and
1900 <function>calloc
<parameter/></function> functions return a pointer to the
1901 allocated memory if successful; otherwise a
<constant>NULL
</constant>
1902 pointer is returned and
<varname>errno
</varname> is set to
1903 <errorname>ENOMEM
</errorname>.
</para>
1905 <para>The
<function>posix_memalign
<parameter/></function> function
1906 returns the value
0 if successful; otherwise it returns an error value.
1907 The
<function>posix_memalign
<parameter/></function> function will fail
1911 <term><errorname>EINVAL
</errorname></term>
1913 <listitem><para>The
<parameter>alignment
</parameter> parameter is
1914 not a power of
2 at least as large as
1915 <code language=
"C">sizeof(
<type>void *
</type>)
</code>.
1919 <term><errorname>ENOMEM
</errorname></term>
1921 <listitem><para>Memory allocation error.
</para></listitem>
1926 <para>The
<function>aligned_alloc
<parameter/></function> function returns
1927 a pointer to the allocated memory if successful; otherwise a
1928 <constant>NULL
</constant> pointer is returned and
1929 <varname>errno
</varname> is set. The
1930 <function>aligned_alloc
<parameter/></function> function will fail if:
1933 <term><errorname>EINVAL
</errorname></term>
1935 <listitem><para>The
<parameter>alignment
</parameter> parameter is
1940 <term><errorname>ENOMEM
</errorname></term>
1942 <listitem><para>Memory allocation error.
</para></listitem>
1947 <para>The
<function>realloc
<parameter/></function> function returns a
1948 pointer, possibly identical to
<parameter>ptr
</parameter>, to the
1949 allocated memory if successful; otherwise a
<constant>NULL
</constant>
1950 pointer is returned, and
<varname>errno
</varname> is set to
1951 <errorname>ENOMEM
</errorname> if the error was the result of an
1952 allocation failure. The
<function>realloc
<parameter/></function>
1953 function always leaves the original buffer intact when an error occurs.
1956 <para>The
<function>free
<parameter/></function> function returns no
1960 <title>Non-standard API
</title>
1961 <para>The
<function>malloc_usable_size
<parameter/></function> function
1962 returns the usable size of the allocation pointed to by
1963 <parameter>ptr
</parameter>.
</para>
1965 <para>The
<function>mallctl
<parameter/></function>,
1966 <function>mallctlnametomib
<parameter/></function>, and
1967 <function>mallctlbymib
<parameter/></function> functions return
0 on
1968 success; otherwise they return an error value. The functions will fail
1972 <term><errorname>EINVAL
</errorname></term>
1974 <listitem><para><parameter>newp
</parameter> is not
1975 <constant>NULL
</constant>, and
<parameter>newlen
</parameter> is too
1976 large or too small. Alternatively,
<parameter>*oldlenp
</parameter>
1977 is too large or too small; in this case as much data as possible
1978 are read despite the error.
</para></listitem>
1981 <term><errorname>ENOMEM
</errorname></term>
1983 <listitem><para><parameter>*oldlenp
</parameter> is too short to
1984 hold the requested value.
</para></listitem>
1987 <term><errorname>ENOENT
</errorname></term>
1989 <listitem><para><parameter>name
</parameter> or
1990 <parameter>mib
</parameter> specifies an unknown/invalid
1991 value.
</para></listitem>
1994 <term><errorname>EPERM
</errorname></term>
1996 <listitem><para>Attempt to read or write void value, or attempt to
1997 write read-only value.
</para></listitem>
2000 <term><errorname>EAGAIN
</errorname></term>
2002 <listitem><para>A memory allocation failure
2003 occurred.
</para></listitem>
2006 <term><errorname>EFAULT
</errorname></term>
2008 <listitem><para>An interface with side effects failed in some way
2009 not directly related to
<function>mallctl*
<parameter/></function>
2010 read/write processing.
</para></listitem>
2016 <title>Experimental API
</title>
2017 <para>The
<function>allocm
<parameter/></function>,
2018 <function>rallocm
<parameter/></function>,
2019 <function>sallocm
<parameter/></function>,
2020 <function>dallocm
<parameter/></function>, and
2021 <function>nallocm
<parameter/></function> functions return
2022 <constant>ALLOCM_SUCCESS
</constant> on success; otherwise they return an
2023 error value. The
<function>allocm
<parameter/></function>,
2024 <function>rallocm
<parameter/></function>, and
2025 <function>nallocm
<parameter/></function> functions will fail if:
2028 <term><errorname>ALLOCM_ERR_OOM
</errorname></term>
2030 <listitem><para>Out of memory. Insufficient contiguous memory was
2031 available to service the allocation request. The
2032 <function>allocm
<parameter/></function> function additionally sets
2033 <parameter>*ptr
</parameter> to
<constant>NULL
</constant>, whereas
2034 the
<function>rallocm
<parameter/></function> function leaves
2035 <constant>*ptr
</constant> unmodified.
</para></listitem>
2038 The
<function>rallocm
<parameter/></function> function will also
2042 <term><errorname>ALLOCM_ERR_NOT_MOVED
</errorname></term>
2044 <listitem><para><constant>ALLOCM_NO_MOVE
</constant> was specified,
2045 but the reallocation request could not be serviced without moving
2046 the object.
</para></listitem>
2052 <refsect1 id=
"environment">
2053 <title>ENVIRONMENT
</title>
2054 <para>The following environment variable affects the execution of the
2055 allocation functions:
2058 <term><envar>MALLOC_CONF
</envar></term>
2060 <listitem><para>If the environment variable
2061 <envar>MALLOC_CONF
</envar> is set, the characters it contains
2062 will be interpreted as options.
</para></listitem>
2067 <refsect1 id=
"examples">
2068 <title>EXAMPLES
</title>
2069 <para>To dump core whenever a problem occurs:
2070 <screen>ln -s 'abort:true' /etc/malloc.conf
</screen>
2072 <para>To specify in the source a chunk size that is
16 MiB:
2073 <programlisting language=
"C"><![CDATA[
2074 malloc_conf = "lg_chunk:
24";]]
></programlisting></para>
2076 <refsect1 id=
"see_also">
2077 <title>SEE ALSO
</title>
2078 <para><citerefentry><refentrytitle>madvise
</refentrytitle>
2079 <manvolnum>2</manvolnum></citerefentry>,
2080 <citerefentry><refentrytitle>mmap
</refentrytitle>
2081 <manvolnum>2</manvolnum></citerefentry>,
2082 <citerefentry><refentrytitle>sbrk
</refentrytitle>
2083 <manvolnum>2</manvolnum></citerefentry>,
2084 <citerefentry><refentrytitle>utrace
</refentrytitle>
2085 <manvolnum>2</manvolnum></citerefentry>,
2086 <citerefentry><refentrytitle>alloca
</refentrytitle>
2087 <manvolnum>3</manvolnum></citerefentry>,
2088 <citerefentry><refentrytitle>atexit
</refentrytitle>
2089 <manvolnum>3</manvolnum></citerefentry>,
2090 <citerefentry><refentrytitle>getpagesize
</refentrytitle>
2091 <manvolnum>3</manvolnum></citerefentry></para>
2093 <refsect1 id=
"standards">
2094 <title>STANDARDS
</title>
2095 <para>The
<function>malloc
<parameter/></function>,
2096 <function>calloc
<parameter/></function>,
2097 <function>realloc
<parameter/></function>, and
2098 <function>free
<parameter/></function> functions conform to ISO/IEC
2099 9899:
1990 (
“ISO C90
”).
</para>
2101 <para>The
<function>posix_memalign
<parameter/></function> function conforms
2102 to IEEE Std
1003.1-
2001 (
“POSIX
.1”).
</para>