1erts_alloc(3)                 C Library Functions                erts_alloc(3)
2
3
4

NAME

6       erts_alloc  -  An  Erlang  runtime system internal memory allocator li‐
7       brary.
8
9

DESCRIPTION

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

ALLOCATORS

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

THE ALLOC_UTIL FRAMEWORK

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

SYSTEM FLAGS EFFECTING ERTS_ALLOC

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>as     bf|aobf|aoff|aoffcbf|aoffcaobf|ageffcaoff|ageffcbf|ageff‐
428         caobf|gf|af:
429           Allocation strategy. The following strategies are valid:
430
431           * bf (best fit)
432
433           * aobf (address order best fit)
434
435           * aoff (address order first fit)
436
437           * aoffcbf (address order first fit carrier best fit)
438
439           * aoffcaobf (address order first fit  carrier  address  order  best
440             fit)
441
442           * ageffcaoff (age order first fit carrier address order first fit)
443
444           * ageffcbf (age order first fit carrier best fit)
445
446           * ageffcaobf (age order first fit carrier address order best fit)
447
448           * gf (good fit)
449
450           * af (a fit)
451
452           See  the  description  of  allocation strategies in section The al‐
453           loc_util Framework.
454
455         +M<S>asbcst <size>:
456           Absolute singleblock carrier shrink threshold (in kilobytes).  When
457           a block located in an mseg_alloc singleblock carrier is shrunk, the
458           carrier is left unchanged if the amount of unused  memory  is  less
459           than  this threshold, otherwise the carrier is shrunk. See also rs‐
460           bcst.
461
462         +M<S>atags true|false:
463           Adds a small tag to each allocated block that contains basic infor‐
464           mation  about  what  it is and who allocated it. Use the instrument
465           module to inspect this information.
466
467           The runtime overhead is one word per allocation when enabled.  This
468           may change at any time in the future.
469
470           The  default  is  true for binary_alloc and driver_alloc, and false
471           for the other allocator types.
472
473         +M<S>cp B|D|E|F|H||L|R|S|@|::
474           Set carrier pool to use for the  allocator.  Memory  carriers  will
475           only  migrate between allocator instances that use the same carrier
476           pool. The following carrier pool names exist:
477
478           B:
479             Carrier pool associated with binary_alloc.
480
481           D:
482             Carrier pool associated with std_alloc.
483
484           E:
485             Carrier pool associated with ets_alloc.
486
487           F:
488             Carrier pool associated with fix_alloc.
489
490           H:
491             Carrier pool associated with eheap_alloc.
492
493           L:
494             Carrier pool associated with ll_alloc.
495
496           R:
497             Carrier pool associated with driver_alloc.
498
499           S:
500             Carrier pool associated with sl_alloc.
501
502           @:
503             Carrier pool associated with the system as a whole.
504
505           Besides passing carrier pool name as value to  the  parameter,  you
506           can also pass :. By passing : instead of carrier pool name, the al‐
507           locator will use the carrier pool associated with itself. By  pass‐
508           ing  the  command line argument "+Mucg :", all allocators that have
509           an associated carrier pool will use  the  carrier  pool  associated
510           with themselves.
511
512           The  association  between carrier pool and allocator is very loose.
513           The associations are more or less only there to get names  for  the
514           amount  of carrier pools needed and names of carrier pools that can
515           be easily identified by the : value.
516
517           This flag is only valid for allocators that have an associated car‐
518           rier pool. Besides that, there are no restrictions on carrier pools
519           to use for an allocator.
520
521           Currently each allocator with an associated carrier  pool  defaults
522           to using its own associated carrier pool.
523
524         +M<S>e true|false:
525           Enables allocator <S>.
526
527         +M<S>lmbcs <size>:
528           Largest  (mseg_alloc)  multiblock  carrier size (in kilobytes). See
529           the description on how sizes for mseg_alloc multiblock carriers are
530           decided  in section  The alloc_util Framework. On 32-bit Unix style
531           OS this limit cannot be set > 64 MB.
532
533         +M<S>mbcgs <ratio>:
534           (mseg_alloc) multiblock carrier growth stages. See the  description
535           on how sizes for mseg_alloc multiblock carriers are decided in sec‐
536           tion  The alloc_util Framework.
537
538         +M<S>mbsd <depth>:
539           Maximum block search depth. This flag has effect only if  the  good
540           fit  strategy  is  selected  for  allocator  <S>. When the good fit
541           strategy is used, free blocks are placed in segregated  free-lists.
542           Each  free-list  contains  blocks of sizes in a specific range. The
543           maxiumum block search depth sets a limit on the maximum  number  of
544           blocks to inspect in a free-list during a search for suitable block
545           satisfying the request.
546
547         +M<S>mmbcs <size>:
548           Main multiblock carrier size. Sets the size of the main  multiblock
549           carrier for allocator <S>. The main multiblock carrier is allocated
550           through sys_alloc and is never deallocated.
551
552         +M<S>mmmbc <amount>:
553           Maximum mseg_alloc multiblock carriers. Maximum  number  of  multi‐
554           block  carriers allocated through mseg_alloc by allocator <S>. When
555           this limit  is  reached,  new  multiblock  carriers  are  allocated
556           through sys_alloc.
557
558         +M<S>mmsbc <amount>:
559           Maximum  mseg_alloc singleblock carriers. Maximum number of single‐
560           block carriers allocated through mseg_alloc by allocator <S>.  When
561           this  limit  is  reached,  new  singleblock  carriers are allocated
562           through sys_alloc.
563
564         +M<S>ramv <bool>:
565           Realloc always moves. When enabled, reallocate operations are  more
566           or  less translated into an allocate, copy, free sequence. This of‐
567           ten reduces memory fragmentation, but costs performance.
568
569         +M<S>rmbcmt <ratio>:
570           Relative multiblock carrier move threshold  (in  percent).  When  a
571           block located in a multiblock carrier is shrunk, the block is moved
572           if the ratio of the size of the freed memory compared to the previ‐
573           ous size is more than this threshold, otherwise the block is shrunk
574           at the current location.
575
576         +M<S>rsbcmt <ratio>:
577           Relative singleblock carrier move threshold (in  percent).  When  a
578           block  located in a singleblock carrier is shrunk to a size smaller
579           than the value of parameter sbct, the block is  left  unchanged  in
580           the  singleblock carrier if the ratio of unused memory is less than
581           this threshold, otherwise it is moved into a multiblock carrier.
582
583         +M<S>rsbcst <ratio>:
584           Relative singleblock carrier shrink threshold (in percent). When  a
585           block  located  in an mseg_alloc singleblock carrier is shrunk, the
586           carrier is left unchanged if the ratio of  unused  memory  is  less
587           than  this threshold, otherwise the carrier is shrunk. See also as‐
588           bcst.
589
590         +M<S>sbct <size>:
591           Singleblock carrier threshold (in kilobytes).  Blocks  larger  than
592           this  threshold  are placed in singleblock carriers. Blocks smaller
593           than this threshold are placed in multiblock  carriers.  On  32-bit
594           Unix style OS this threshold cannot be set > 8 MB.
595
596         +M<S>smbcs <size>:
597           Smallest  (mseg_alloc)  multiblock carrier size (in kilobytes). See
598           the description on how sizes for mseg_alloc multiblock carriers are
599           decided in section  The alloc_util Framework.
600
601         +M<S>t true|false:
602           Multiple,  thread-specific  instances of the allocator. Default be‐
603           havior is NoSchedulers+1 instances. Each scheduler uses a lock-free
604           instance of its own and other threads use a common instance.
605
606           Before  ERTS  5.9  it was possible to configure a smaller number of
607           thread-specific instances than schedulers. This  is,  however,  not
608           possible anymore.
609
610   Flags for Configuration of alloc_util
611       All allocators based on alloc_util are effected.
612
613         +Muycs <size>:
614           sys_alloc  carrier  size.  Carriers allocated through sys_alloc are
615           allocated in sizes that are  multiples  of  the  sys_alloc  carrier
616           size.  This  is  not true for main multiblock carriers and carriers
617           allocated during a memory shortage, though.
618
619         +Mummc <amount>:
620           Maximum mseg_alloc carriers. Maximum number of carriers  placed  in
621           separate  memory segments. When this limit is reached, new carriers
622           are placed in memory retrieved from sys_alloc.
623
624         +Musac <bool>:
625           Allow sys_alloc carriers.  Defaults  to  true.  If  set  to  false,
626           sys_alloc  carriers  are  never created by allocators using the al‐
627           loc_util framework.
628
629   Special Flag for literal_alloc
630         +MIscs <size in MB>:
631           literal_alloc super carrier size (in MB). The amount of virtual ad‐
632           dress space reserved for literal terms in Erlang code on 64-bit ar‐
633           chitectures. Defaults to 1024 (that is, 1  GB),  which  is  usually
634           sufficient. The flag is ignored on 32-bit architectures.
635
636   Instrumentation Flags
637         +M<S>atags:
638           Adds a small tag to each allocated block that contains basic infor‐
639           mation about what it is and who allocated it. See +M<S>atags for  a
640           more complete description.
641
642         +Mit X:
643           Reserved for future use. Do not use this flag.
644
645   Note:
646       When instrumentation of the emulator is enabled, the emulator uses more
647       memory and runs slower.
648
649
650   Other Flags
651         +Mea min|max|r9c|r10b|r11b|config:
652           Options:
653
654           min:
655             Disables all allocators that can be disabled.
656
657           max:
658             Enables all allocators (default).
659
660           r9c|r10b|r11b:
661             Configures all allocators as they were configured  in  respective
662             Erlang/OTP release. These will eventually be removed.
663
664           config:
665             Disables  features that cannot be enabled while creating an allo‐
666             cator configuration with erts_alloc_config(3).
667
668       Note:
669           This option is to be used only while running  erts_alloc_config(3),
670           not when using the created configuration.
671
672
673         +Mlpm all|no:
674           Lock  physical  memory. Defaults to no, that is, no physical memory
675           is locked. If set to all, all memory mappings made by  the  runtime
676           system  are locked into physical memory. If set to all, the runtime
677           system fails to start if this feature is not  supported,  the  user
678           has  not  got enough privileges, or the user is not allowed to lock
679           enough physical memory. The runtime system also fails with  an  out
680           of  memory condition if the user limit on the amount of locked mem‐
681           ory is reached.
682
683         +Mdai max|<amount>:
684           Set amount of dirty allocator instances used. Defaults to  0.  That
685           is, by default no instances will be used. The maximum amount of in‐
686           stances equals the amount of dirty CPU schedulers on the system.
687
688           By default, each normal scheduler thread has its own allocator  in‐
689           stance for each allocator. All other threads in the system, includ‐
690           ing dirty schedulers, share one instance for each allocator. By en‐
691           abling dirty allocator instances, dirty schedulers will get and use
692           their own set of allocator instances. Note that these instances are
693           not  exclusive  to  each  dirty scheduler, but instead shared among
694           dirty schedulers. The more instances used the  less  risk  of  lock
695           contention on these allocator instances. Memory consumption do how‐
696           ever increase with increased amount of dirty allocator instances.
697

NOTES

699       Only some default values have  been  presented  here.  For  information
700       about the currently used settings and the current status of the alloca‐
701       tors, see erlang:system_info(allocator) and erlang:system_info({alloca‐
702       tor, Alloc}).
703
704   Note:
705       Most  of  these  flags  are  highly implementation-dependent and can be
706       changed or removed without prior notice.
707
708       erts_alloc is not obliged to strictly use the settings that  have  been
709       passed to it (it can even ignore them).
710
711
712       The  erts_alloc_config(3)  tool  can  be  used  to  aid  creation of an
713       erts_alloc configuration that is suitable for a limited number of  run‐
714       time scenarios.
715

SEE ALSO

717       erl(1), erlang(3), erts_alloc_config(3), instrument(3)
718
719
720
721Ericsson AB                      erts 12.3.2.1                   erts_alloc(3)
Impressum