1erts_alloc(3) C Library Functions erts_alloc(3)
2
3
4
6 erts_alloc - An Erlang runtime system internal memory allocator li‐
7 brary.
8
9
11 erts_alloc is an Erlang runtime system internal memory allocator li‐
12 brary. erts_alloc provides the Erlang runtime system with a number of
13 memory allocators.
14
16 The following allocators are present:
17
18 temp_alloc:
19 Allocator used for temporary allocations.
20
21 eheap_alloc:
22 Allocator used for Erlang heap data, such as Erlang process heaps.
23
24 binary_alloc:
25 Allocator used for Erlang binary data.
26
27 ets_alloc:
28 Allocator used for ets data.
29
30 driver_alloc:
31 Allocator used for driver data.
32
33 literal_alloc:
34 Allocator used for constant terms in Erlang code.
35
36 sl_alloc:
37 Allocator used for memory blocks that are expected to be short-
38 lived.
39
40 ll_alloc:
41 Allocator used for memory blocks that are expected to be long-
42 lived, for example, Erlang code.
43
44 fix_alloc:
45 A fast allocator used for some frequently used fixed size data
46 types.
47
48 std_alloc:
49 Allocator used for most memory blocks not allocated through any of
50 the other allocators described above.
51
52 sys_alloc:
53 This is normally the default malloc implementation used on the spe‐
54 cific OS.
55
56 mseg_alloc:
57 A memory segment allocator. It is used by other allocators for al‐
58 locating memory segments and is only available on systems that have
59 the mmap system call. Memory segments that are deallocated are kept
60 for a while in a segment cache before they are destroyed. When seg‐
61 ments are allocated, cached segments are used if possible instead
62 of creating new segments. This to reduce the number of system calls
63 made.
64
65 sys_alloc, literal_alloc and temp_alloc are always enabled and cannot
66 be disabled. mseg_alloc is always enabled if it is available and an al‐
67 locator that uses it is enabled. All other allocators can be enabled or
68 disabled. By default all allocators are enabled. When an allocator is
69 disabled, sys_alloc is used instead of the disabled allocator.
70
71 The main idea with the erts_alloc library is to separate memory blocks
72 that are used differently into different memory areas, to achieve less
73 memory fragmentation. By putting less effort in finding a good fit for
74 memory blocks that are frequently allocated than for those less fre‐
75 quently allocated, a performance gain can be achieved.
76
78 Internally a framework called alloc_util is used for implementing allo‐
79 cators. sys_alloc and mseg_alloc do not use this framework, so the fol‐
80 lowing does not apply to them.
81
82 An allocator manages multiple areas, called carriers, in which memory
83 blocks are placed. A carrier is either placed in a separate memory seg‐
84 ment (allocated through mseg_alloc), or in the heap segment (allocated
85 through sys_alloc).
86
87 * Multiblock carriers are used for storage of several blocks.
88
89 * Singleblock carriers are used for storage of one block.
90
91 * Blocks that are larger than the value of the singleblock carrier
92 threshold (sbct) parameter are placed in singleblock carriers.
93
94 * Blocks that are smaller than the value of parameter sbct are placed
95 in multiblock carriers.
96
97 Normally an allocator creates a "main multiblock carrier". Main multi‐
98 block carriers are never deallocated. The size of the main multiblock
99 carrier is determined by the value of parameter mmbcs.
100
101 Sizes of multiblock carriers allocated through mseg_alloc are decided
102 based on the following parameters:
103
104 * The values of the largest multiblock carrier size (lmbcs)
105
106 * The smallest multiblock carrier size (smbcs)
107
108 * The multiblock carrier growth stages (mbcgs)
109
110 If nc is the current number of multiblock carriers (the main multiblock
111 carrier excluded) managed by an allocator, the size of the next
112 mseg_alloc multiblock carrier allocated by this allocator is roughly
113 smbcs+nc*(lmbcs-smbcs)/mbcgs when nc <= mbcgs, and lmbcs when nc >
114 mbcgs. If the value of parameter sbct is larger than the value of pa‐
115 rameter lmbcs, the allocator may have to create multiblock carriers
116 that are larger than the value of parameter lmbcs, though. Singleblock
117 carriers allocated through mseg_alloc are sized to whole pages.
118
119 Sizes of carriers allocated through sys_alloc are decided based on the
120 value of the sys_alloc carrier size (ycs) parameter. The size of a car‐
121 rier is the least number of multiples of the value of parameter ycs
122 satisfying the request.
123
124 Coalescing of free blocks are always performed immediately. Boundary
125 tags (headers and footers) in free blocks are used, which makes the
126 time complexity for coalescing constant.
127
128 The memory allocation strategy used for multiblock carriers by an allo‐
129 cator can be configured using parameter as. The following strategies
130 are available:
131
132 Best fit:
133 Strategy: Find the smallest block satisfying the requested block
134 size.
135
136 Implementation: A balanced binary search tree is used. The time
137 complexity is proportional to log N, where N is the number of sizes
138 of free blocks.
139
140 Address order best fit:
141 Strategy: Find the smallest block satisfying the requested block
142 size. If multiple blocks are found, choose the one with the lowest
143 address.
144
145 Implementation: A balanced binary search tree is used. The time
146 complexity is proportional to log N, where N is the number of free
147 blocks.
148
149 Address order first fit:
150 Strategy: Find the block with the lowest address satisfying the re‐
151 quested block size.
152
153 Implementation: A balanced binary search tree is used. The time
154 complexity is proportional to log N, where N is the number of free
155 blocks.
156
157 Address order first fit carrier best fit:
158 Strategy: Find the carrier with the lowest address that can satisfy
159 the requested block size, then find a block within that carrier us‐
160 ing the "best fit" strategy.
161
162 Implementation: Balanced binary search trees are used. The time
163 complexity is proportional to log N, where N is the number of free
164 blocks.
165
166 Address order first fit carrier address order best fit:
167 Strategy: Find the carrier with the lowest address that can satisfy
168 the requested block size, then find a block within that carrier us‐
169 ing the "address order best fit" strategy.
170
171 Implementation: Balanced binary search trees are used. The time
172 complexity is proportional to log N, where N is the number of free
173 blocks.
174
175 Age order first fit carrier address order first fit:
176 Strategy: Find the oldest carrier that can satisfy the requested
177 block size, then find a block within that carrier using the "ad‐
178 dress order first fit" strategy.
179
180 Implementation: A balanced binary search tree is used. The time
181 complexity is proportional to log N, where N is the number of free
182 blocks.
183
184 Age order first fit carrier best fit:
185 Strategy: Find the oldest carrier that can satisfy the requested
186 block size, then find a block within that carrier using the "best
187 fit" strategy.
188
189 Implementation: Balanced binary search trees are used. The time
190 complexity is proportional to log N, where N is the number of free
191 blocks.
192
193 Age order first fit carrier address order best fit:
194 Strategy: Find the oldest carrier that can satisfy the requested
195 block size, then find a block within that carrier using the "ad‐
196 dress order best fit" strategy.
197
198 Implementation: Balanced binary search trees are used. The time
199 complexity is proportional to log N, where N is the number of free
200 blocks.
201
202 Good fit:
203 Strategy: Try to find the best fit, but settle for the best fit
204 found during a limited search.
205
206 Implementation: The implementation uses segregated free lists with
207 a maximum block search depth (in each list) to find a good fit
208 fast. When the maximum block search depth is small (by default 3),
209 this implementation has a time complexity that is constant. The
210 maximum block search depth can be configured using parameter mbsd.
211
212 A fit:
213 Strategy: Do not search for a fit, inspect only one free block to
214 see if it satisfies the request. This strategy is only intended to
215 be used for temporary allocations.
216
217 Implementation: Inspect the first block in a free-list. If it sat‐
218 isfies the request, it is used, otherwise a new carrier is created.
219 The implementation has a time complexity that is constant.
220
221 As from ERTS 5.6.1 the emulator refuses to use this strategy on
222 other allocators than temp_alloc. This because it only causes prob‐
223 lems for other allocators.
224
225 Apart from the ordinary allocators described above, some pre-allocators
226 are used for some specific data types. These pre-allocators pre-allo‐
227 cate a fixed amount of memory for certain data types when the runtime
228 system starts. As long as pre-allocated memory is available, it is
229 used. When no pre-allocated memory is available, memory is allocated in
230 ordinary allocators. These pre-allocators are typically much faster
231 than the ordinary allocators, but can only satisfy a limited number of
232 requests.
233
235 Warning:
236 Only use these flags if you are sure what you are doing. Unsuitable
237 settings can cause serious performance degradation and even a system
238 crash at any time during operation.
239
240
241 Memory allocator system flags have the following syntax: +M<S><P> <V>,
242 where <S> is a letter identifying a subsystem, <P> is a parameter, and
243 <V> is the value to use. The flags can be passed to the Erlang emulator
244 (erl(1)) as command-line arguments.
245
246 System flags effecting specific allocators have an uppercase letter as
247 <S>. The following letters are used for the allocators:
248
249 * B: binary_alloc
250
251 * D: std_alloc
252
253 * E: ets_alloc
254
255 * F: fix_alloc
256
257 * H: eheap_alloc
258
259 * I: literal_alloc
260
261 * L: ll_alloc
262
263 * M: mseg_alloc
264
265 * R: driver_alloc
266
267 * S: sl_alloc
268
269 * T: temp_alloc
270
271 * Y: sys_alloc
272
273 Flags for Configuration of mseg_alloc
274 +MMamcbf <size>:
275 Absolute maximum cache bad fit (in kilobytes). A segment in the
276 memory segment cache is not reused if its size exceeds the re‐
277 quested size with more than the value of this parameter. Defaults
278 to 4096.
279
280 +MMrmcbf <ratio>:
281 Relative maximum cache bad fit (in percent). A segment in the mem‐
282 ory segment cache is not reused if its size exceeds the requested
283 size with more than relative maximum cache bad fit percent of the
284 requested size. Defaults to 20.
285
286 +MMsco true|false:
287 Sets super carrier only flag. Defaults to true. When a super car‐
288 rier is used and this flag is true, mseg_alloc only creates carri‐
289 ers in the super carrier. Notice that the alloc_util framework can
290 create sys_alloc carriers, so if you want all carriers to be cre‐
291 ated in the super carrier, you therefore want to disable use of
292 sys_alloc carriers by also passing +Musac false. When the flag is
293 false, mseg_alloc tries to create carriers outside of the super
294 carrier when the super carrier is full.
295
296 Note:
297 Setting this flag to false is not supported on all systems. The flag
298 is then ignored.
299
300
301 +MMscrfsd <amount>:
302 Sets super carrier reserved free segment descriptors. Defaults to
303 65536. This parameter determines the amount of memory to reserve
304 for free segment descriptors used by the super carrier. If the sys‐
305 tem runs out of reserved memory for free segment descriptors, other
306 memory is used. This can however cause fragmentation issues, so you
307 want to ensure that this never happens. The maximum amount of free
308 segment descriptors used can be retrieved from the erts_mmap tuple
309 part of the result from calling erlang:system_info({allocator,
310 mseg_alloc}).
311
312 +MMscrpm true|false:
313 Sets super carrier reserve physical memory flag. Defaults to true.
314 When this flag is true, physical memory is reserved for the whole
315 super carrier at once when it is created. The reservation is after
316 that left unchanged. When this flag is set to false, only virtual
317 address space is reserved for the super carrier upon creation. The
318 system attempts to reserve physical memory upon carrier creations
319 in the super carrier, and attempt to unreserve physical memory upon
320 carrier destructions in the super carrier.
321
322 Note:
323 What reservation of physical memory means, highly depends on the op‐
324 erating system, and how it is configured. For example, different mem‐
325 ory overcommit settings on Linux drastically change the behavior.
326
327 Setting this flag to false is possibly not supported on all systems.
328 The flag is then ignored.
329
330
331 +MMscs <size in MB>:
332 Sets super carrier size (in MB). Defaults to 0, that is, the super
333 carrier is by default disabled. The super carrier is a large con‐
334 tinuous area in the virtual address space. mseg_alloc always tries
335 to create new carriers in the super carrier if it exists. Notice
336 that the alloc_util framework can create sys_alloc carriers. For
337 more information, see +MMsco.
338
339 +MMmcs <amount>:
340 Maximum cached segments. The maximum number of memory segments
341 stored in the memory segment cache. Valid range is [0, 30]. De‐
342 faults to 10.
343
344 Flags for Configuration of sys_alloc
345 +MYe true:
346 Enables sys_alloc.
347
348 Note:
349 sys_alloc cannot be disabled.
350
351
352 +MYtt <size>:
353 Trim threshold size (in kilobytes). This is the maximum amount of
354 free memory at the top of the heap (allocated by sbrk) that is kept
355 by malloc (not released to the operating system). When the amount
356 of free memory at the top of the heap exceeds the trim threshold,
357 malloc releases it (by calling sbrk). Trim threshold is specified
358 in kilobytes. Defaults to 128.
359
360 Note:
361 This flag has effect only when the emulator is linked with the GNU C
362 library, and uses its malloc implementation.
363
364
365 +MYtp <size>:
366 Top pad size (in kilobytes). This is the amount of extra memory
367 that is allocated by malloc when sbrk is called to get more memory
368 from the operating system. Defaults to 0.
369
370 Note:
371 This flag has effect only when the emulator is linked with the GNU C
372 library, and uses its malloc implementation.
373
374
375 Flags for Configuration of Allocators Based on alloc_util
376 If u is used as subsystem identifier (that is, <S> = u), all allocators
377 based on alloc_util are effected. If B, D, E, F, H, I, L, R, S, T, X is
378 used as subsystem identifier, only the specific allocator identifier is
379 effected.
380
381 +M<S>acul <utilization>|de:
382 Abandon carrier utilization limit. A valid <utilization> is an in‐
383 teger in the range [0, 100] representing utilization in percent.
384 When a utilization value > 0 is used, allocator instances are al‐
385 lowed to abandon multiblock carriers. If de (default enabled) is
386 passed instead of a <utilization>, a recommended non-zero utiliza‐
387 tion value is used. The value chosen depends on the allocator type
388 and can be changed between ERTS versions. Defaults to de, but this
389 can be changed in the future.
390
391 Carriers are abandoned when memory utilization in the allocator in‐
392 stance falls below the utilization value used. Once a carrier is
393 abandoned, no new allocations are made in it. When an allocator in‐
394 stance gets an increased multiblock carrier need, it first tries to
395 fetch an abandoned carrier from another allocator instance. If no
396 abandoned carrier can be fetched, it creates a new empty carrier.
397 When an abandoned carrier has been fetched, it will function as an
398 ordinary carrier. This feature has special requirements on the al‐
399 location strategy used. Only the strategies aoff, aoffcbf, aoff‐
400 caobf, ageffcaoffm, ageffcbf and ageffcaobf support abandoned car‐
401 riers.
402
403 This feature also requires multiple thread specific instances to be
404 enabled. When enabling this feature, multiple thread-specific in‐
405 stances are enabled if not already enabled, and the aoffcbf strat‐
406 egy is enabled if the current strategy does not support abandoned
407 carriers. This feature can be enabled on all allocators based on
408 the alloc_util framework, except temp_alloc (which would be point‐
409 less).
410
411 +M<S>acfml <bytes>:
412 Abandon carrier free block min limit. A valid <bytes> is a positive
413 integer representing a block size limit. The largest free block in
414 a carrier must be at least bytes large, for the carrier to be aban‐
415 doned. The default is zero but can be changed in the future.
416
417 See also acul.
418
419 +M<S>acnl <amount>:
420 Abandon carrier number limit. A valid <amount> is a positive inte‐
421 ger representing max number of abandoned carriers per allocator in‐
422 stance. Defaults to 1000 which will practically disable the limit,
423 but this can be changed in the future.
424
425 See also acul.
426
427 +M<S>acful <utilization>|de:
428 Abandon carrier free utilization limit. When the utilization of a
429 carrier falls belows this limit erts_alloc instructs the OS that
430 unused memory in the carrier can be re-used for allocation by other
431 OS procesesses. On Unix this is done by calling madvise(..., ...,
432 MADV_FREE) on the unused memory region, on Windows it is done by
433 calling VirtualAlloc(..., ..., MEM_RESET, PAGE_READWRITE). Defaults
434 to 0 which means that no memory will be marked as re-usable by the
435 OS.
436
437 A valid <utilization> is an integer in the range [0, 100] repre‐
438 senting utilization in percent. If this value is larger than the
439 acul limit it will be lowered to the current acul limit. If de (de‐
440 fault enabled) is passed instead of a <utilization>, a recommended
441 non-zero utilization value is used. The value chosen depends on the
442 allocator type and can be changed between ERTS versions.
443
444 See also acul.
445
446 +M<S>as bf|aobf|aoff|aoffcbf|aoffcaobf|ageffcaoff|ageffcbf|ageff‐
447 caobf|gf|af:
448 Allocation strategy. The following strategies are valid:
449
450 * bf (best fit)
451
452 * aobf (address order best fit)
453
454 * aoff (address order first fit)
455
456 * aoffcbf (address order first fit carrier best fit)
457
458 * aoffcaobf (address order first fit carrier address order best
459 fit)
460
461 * ageffcaoff (age order first fit carrier address order first fit)
462
463 * ageffcbf (age order first fit carrier best fit)
464
465 * ageffcaobf (age order first fit carrier address order best fit)
466
467 * gf (good fit)
468
469 * af (a fit)
470
471 See the description of allocation strategies in section The al‐
472 loc_util Framework.
473
474 +M<S>asbcst <size>:
475 Absolute singleblock carrier shrink threshold (in kilobytes). When
476 a block located in an mseg_alloc singleblock carrier is shrunk, the
477 carrier is left unchanged if the amount of unused memory is less
478 than this threshold, otherwise the carrier is shrunk. See also rs‐
479 bcst.
480
481 +M<S>atags true|false:
482 Adds a small tag to each allocated block that contains basic infor‐
483 mation about what it is and who allocated it. Use the instrument
484 module to inspect this information.
485
486 The runtime overhead is one word per allocation when enabled. This
487 may change at any time in the future.
488
489 The default is true for binary_alloc and driver_alloc, and false
490 for the other allocator types.
491
492 +M<S>cp B|D|E|F|H||L|R|S|@|::
493 Set carrier pool to use for the allocator. Memory carriers will
494 only migrate between allocator instances that use the same carrier
495 pool. The following carrier pool names exist:
496
497 B:
498 Carrier pool associated with binary_alloc.
499
500 D:
501 Carrier pool associated with std_alloc.
502
503 E:
504 Carrier pool associated with ets_alloc.
505
506 F:
507 Carrier pool associated with fix_alloc.
508
509 H:
510 Carrier pool associated with eheap_alloc.
511
512 L:
513 Carrier pool associated with ll_alloc.
514
515 R:
516 Carrier pool associated with driver_alloc.
517
518 S:
519 Carrier pool associated with sl_alloc.
520
521 @:
522 Carrier pool associated with the system as a whole.
523
524 Besides passing carrier pool name as value to the parameter, you
525 can also pass :. By passing : instead of carrier pool name, the al‐
526 locator will use the carrier pool associated with itself. By pass‐
527 ing the command line argument "+Mucg :", all allocators that have
528 an associated carrier pool will use the carrier pool associated
529 with themselves.
530
531 The association between carrier pool and allocator is very loose.
532 The associations are more or less only there to get names for the
533 amount of carrier pools needed and names of carrier pools that can
534 be easily identified by the : value.
535
536 This flag is only valid for allocators that have an associated car‐
537 rier pool. Besides that, there are no restrictions on carrier pools
538 to use for an allocator.
539
540 Currently each allocator with an associated carrier pool defaults
541 to using its own associated carrier pool.
542
543 +M<S>e true|false:
544 Enables allocator <S>.
545
546 +M<S>lmbcs <size>:
547 Largest (mseg_alloc) multiblock carrier size (in kilobytes). See
548 the description on how sizes for mseg_alloc multiblock carriers are
549 decided in section The alloc_util Framework. On 32-bit Unix style
550 OS this limit cannot be set > 64 MB.
551
552 +M<S>mbcgs <ratio>:
553 (mseg_alloc) multiblock carrier growth stages. See the description
554 on how sizes for mseg_alloc multiblock carriers are decided in sec‐
555 tion The alloc_util Framework.
556
557 +M<S>mbsd <depth>:
558 Maximum block search depth. This flag has effect only if the good
559 fit strategy is selected for allocator <S>. When the good fit
560 strategy is used, free blocks are placed in segregated free-lists.
561 Each free-list contains blocks of sizes in a specific range. The
562 maximum block search depth sets a limit on the maximum number of
563 blocks to inspect in a free-list during a search for suitable block
564 satisfying the request.
565
566 +M<S>mmbcs <size>:
567 Main multiblock carrier size. Sets the size of the main multiblock
568 carrier for allocator <S>. The main multiblock carrier is allocated
569 through sys_alloc and is never deallocated.
570
571 +M<S>mmmbc <amount>:
572 Maximum mseg_alloc multiblock carriers. Maximum number of multi‐
573 block carriers allocated through mseg_alloc by allocator <S>. When
574 this limit is reached, new multiblock carriers are allocated
575 through sys_alloc.
576
577 +M<S>mmsbc <amount>:
578 Maximum mseg_alloc singleblock carriers. Maximum number of single‐
579 block carriers allocated through mseg_alloc by allocator <S>. When
580 this limit is reached, new singleblock carriers are allocated
581 through sys_alloc.
582
583 +M<S>ramv <bool>:
584 Realloc always moves. When enabled, reallocate operations are more
585 or less translated into an allocate, copy, free sequence. This of‐
586 ten reduces memory fragmentation, but costs performance.
587
588 +M<S>rmbcmt <ratio>:
589 Relative multiblock carrier move threshold (in percent). When a
590 block located in a multiblock carrier is shrunk, the block is moved
591 if the ratio of the size of the freed memory compared to the previ‐
592 ous size is more than this threshold, otherwise the block is shrunk
593 at the current location.
594
595 +M<S>rsbcmt <ratio>:
596 Relative singleblock carrier move threshold (in percent). When a
597 block located in a singleblock carrier is shrunk to a size smaller
598 than the value of parameter sbct, the block is left unchanged in
599 the singleblock carrier if the ratio of unused memory is less than
600 this threshold, otherwise it is moved into a multiblock carrier.
601
602 +M<S>rsbcst <ratio>:
603 Relative singleblock carrier shrink threshold (in percent). When a
604 block located in an mseg_alloc singleblock carrier is shrunk, the
605 carrier is left unchanged if the ratio of unused memory is less
606 than this threshold, otherwise the carrier is shrunk. See also as‐
607 bcst.
608
609 +M<S>sbct <size>:
610 Singleblock carrier threshold (in kilobytes). Blocks larger than
611 this threshold are placed in singleblock carriers. Blocks smaller
612 than this threshold are placed in multiblock carriers. On 32-bit
613 Unix style OS this threshold cannot be set > 8 MB.
614
615 +M<S>smbcs <size>:
616 Smallest (mseg_alloc) multiblock carrier size (in kilobytes). See
617 the description on how sizes for mseg_alloc multiblock carriers are
618 decided in section The alloc_util Framework.
619
620 +M<S>t true|false:
621 Multiple, thread-specific instances of the allocator. Default be‐
622 havior is NoSchedulers+1 instances. Each scheduler uses a lock-free
623 instance of its own and other threads use a common instance.
624
625 Before ERTS 5.9 it was possible to configure a smaller number of
626 thread-specific instances than schedulers. This is, however, not
627 possible anymore.
628
629 Flags for Configuration of alloc_util
630 All allocators based on alloc_util are effected.
631
632 +Muycs <size>:
633 sys_alloc carrier size. Carriers allocated through sys_alloc are
634 allocated in sizes that are multiples of the sys_alloc carrier
635 size. This is not true for main multiblock carriers and carriers
636 allocated during a memory shortage, though.
637
638 +Mummc <amount>:
639 Maximum mseg_alloc carriers. Maximum number of carriers placed in
640 separate memory segments. When this limit is reached, new carriers
641 are placed in memory retrieved from sys_alloc.
642
643 +Musac <bool>:
644 Allow sys_alloc carriers. Defaults to true. If set to false,
645 sys_alloc carriers are never created by allocators using the al‐
646 loc_util framework.
647
648 Special Flag for literal_alloc
649 +MIscs <size in MB>:
650 literal_alloc super carrier size (in MB). The amount of virtual ad‐
651 dress space reserved for literal terms in Erlang code on 64-bit ar‐
652 chitectures. Defaults to 1024 (that is, 1 GB), which is usually
653 sufficient. The flag is ignored on 32-bit architectures.
654
655 Instrumentation Flags
656 +M<S>atags:
657 Adds a small tag to each allocated block that contains basic infor‐
658 mation about what it is and who allocated it. See +M<S>atags for a
659 more complete description.
660
661 Note:
662 When instrumentation of the emulator is enabled, the emulator uses more
663 memory and runs slower.
664
665
666 Other Flags
667 +Mea min|max|r9c|r10b|r11b|config:
668 Options:
669
670 min:
671 Disables all allocators that can be disabled.
672
673 max:
674 Enables all allocators (default).
675
676 r9c|r10b|r11b:
677 Configures all allocators as they were configured in respective
678 Erlang/OTP release. These will eventually be removed.
679
680 config:
681 Disables features that cannot be enabled while creating an allo‐
682 cator configuration with erts_alloc_config(3).
683
684 Note:
685 This option is to be used only while running erts_alloc_config(3),
686 not when using the created configuration.
687
688
689 +Mlpm all|no:
690 Lock physical memory. Defaults to no, that is, no physical memory
691 is locked. If set to all, all memory mappings made by the runtime
692 system are locked into physical memory. If set to all, the runtime
693 system fails to start if this feature is not supported, the user
694 has not got enough privileges, or the user is not allowed to lock
695 enough physical memory. The runtime system also fails with an out
696 of memory condition if the user limit on the amount of locked mem‐
697 ory is reached.
698
699 +Mdai max|<amount>:
700 Set amount of dirty allocator instances used. Defaults to 0. That
701 is, by default no instances will be used. The maximum amount of in‐
702 stances equals the amount of dirty CPU schedulers on the system.
703
704 By default, each normal scheduler thread has its own allocator in‐
705 stance for each allocator. All other threads in the system, includ‐
706 ing dirty schedulers, share one instance for each allocator. By en‐
707 abling dirty allocator instances, dirty schedulers will get and use
708 their own set of allocator instances. Note that these instances are
709 not exclusive to each dirty scheduler, but instead shared among
710 dirty schedulers. The more instances used the less risk of lock
711 contention on these allocator instances. Memory consumption do how‐
712 ever increase with increased amount of dirty allocator instances.
713
715 Only some default values have been presented here. For information
716 about the currently used settings and the current status of the alloca‐
717 tors, see erlang:system_info(allocator) and erlang:system_info({alloca‐
718 tor, Alloc}).
719
720 Note:
721 Most of these flags are highly implementation-dependent and can be
722 changed or removed without prior notice.
723
724 erts_alloc is not obliged to strictly use the settings that have been
725 passed to it (it can even ignore them).
726
727
728 The erts_alloc_config(3) tool can be used to aid creation of an
729 erts_alloc configuration that is suitable for a limited number of run‐
730 time scenarios.
731
733 erl(1), erlang(3), erts_alloc_config(3), instrument(3)
734
735
736
737Ericsson AB erts 13.2.2.4 erts_alloc(3)