Warning:
Only use these flags if you are sure what you are doing. Unsuitable settings can cause serious
performance degradation and even a system crash at any time during operation.
Memory allocator system flags have the following syntax: +M<S><P><V>, where <S> is a letter identifying
a subsystem, <P> is a parameter, and <V> is the value to use. The flags can be passed to the Erlang
emulator (erl(1)) as command-line arguments.
System flags effecting specific allocators have an uppercase letter as <S>. The following letters are
used for the allocators:
* B:binary_alloc
* D:std_alloc
* E:ets_alloc
* F:fix_alloc
* H:eheap_alloc
* I:literal_alloc
* L:ll_alloc
* M:mseg_alloc
* R:driver_alloc
* S:sl_alloc
* T:temp_alloc
* Y:sys_allocFlagsforConfigurationofmseg_alloc+MMamcbf<size>:
Absolute maximum cache bad fit (in kilobytes). A segment in the memory segment cache is not reused if
its size exceeds the requested size with more than the value of this parameter. Defaults to 4096.
+MMrmcbf<ratio>:
Relative maximum cache bad fit (in percent). A segment in the memory segment cache is not reused if
its size exceeds the requested size with more than relative maximum cache bad fit percent of the
requested size. Defaults to 20.
+MMscotrue|false:
Sets super carrier only flag. Defaults to true. When a super carrier is used and this flag is true,
mseg_alloc only creates carriers in the super carrier. Notice that the alloc_util framework can
create sys_alloc carriers, so if you want all carriers to be created in the super carrier, you
therefore want to disable use of sys_alloc carriers by also passing +Musacfalse. When the flag is
false, mseg_alloc tries to create carriers outside of the super carrier when the super carrier is
full.
Note:
Setting this flag to false is not supported on all systems. The flag is then ignored.
+MMscrfsd<amount>:
Sets super carrier reserved free segment descriptors. Defaults to 65536. This parameter determines
the amount of memory to reserve for free segment descriptors used by the super carrier. If the system
runs out of reserved memory for free segment descriptors, other memory is used. This can however
cause fragmentation issues, so you want to ensure that this never happens. The maximum amount of free
segment descriptors used can be retrieved from the erts_mmap tuple part of the result from calling
erlang:system_info({allocator,mseg_alloc}).
+MMscrpmtrue|false:
Sets super carrier reserve physical memory flag. Defaults to true. When this flag is true, physical
memory is reserved for the whole super carrier at once when it is created. The reservation is after
that left unchanged. When this flag is set to false, only virtual address space is reserved for the
super carrier upon creation. The system attempts to reserve physical memory upon carrier creations in
the super carrier, and attempt to unreserve physical memory upon carrier destructions in the super
carrier.
Note:
What reservation of physical memory means, highly depends on the operating system, and how it is
configured. For example, different memory overcommit settings on Linux drastically change the behavior.
Setting this flag to false is possibly not supported on all systems. The flag is then ignored.
+MMscs<sizeinMB>:
Sets super carrier size (in MB). Defaults to 0, that is, the super carrier is by default disabled.
The super carrier is a large continuous area in the virtual address space. mseg_alloc always tries to
create new carriers in the super carrier if it exists. Notice that the alloc_util framework can
create sys_alloc carriers. For more information, see +MMsco.
+MMmcs<amount>:
Maximum cached segments. The maximum number of memory segments stored in the memory segment cache.
Valid range is [0,30]. Defaults to 10.
FlagsforConfigurationofsys_alloc+MYetrue:
Enables sys_alloc.
Note:sys_alloc cannot be disabled.
+MYtt<size>:
Trim threshold size (in kilobytes). This is the maximum amount of free memory at the top of the heap
(allocated by sbrk) that is kept by malloc (not released to the operating system). When the amount of
free memory at the top of the heap exceeds the trim threshold, malloc releases it (by calling sbrk).
Trim threshold is specified in kilobytes. Defaults to 128.
Note:
This flag has effect only when the emulator is linked with the GNU C library, and uses its malloc
implementation.
+MYtp<size>:
Top pad size (in kilobytes). This is the amount of extra memory that is allocated by malloc when sbrk
is called to get more memory from the operating system. Defaults to 0.
Note:
This flag has effect only when the emulator is linked with the GNU C library, and uses its malloc
implementation.
FlagsforConfigurationofAllocatorsBasedonalloc_util
If u is used as subsystem identifier (that is, <S>=u), all allocators based on alloc_util are effected.
If B, D, E, F, H, I, L, R, S, T, X is used as subsystem identifier, only the specific allocator
identifier is effected.
+M<S>acul<utilization>|de:
Abandon carrier utilization limit. A valid <utilization> is an integer in the range [0,100]
representing utilization in percent. When a utilization value > 0 is used, allocator instances are
allowed to abandon multiblock carriers. If de (default enabled) is passed instead of a <utilization>,
a recommended non-zero utilization value is used. The value chosen depends on the allocator type and
can be changed between ERTS versions. Defaults to de, but this can be changed in the future.
Carriers are abandoned when memory utilization in the allocator instance falls below the utilization
value used. Once a carrier is abandoned, no new allocations are made in it. When an allocator
instance gets an increased multiblock carrier need, it first tries to fetch an abandoned carrier from
another allocator instance. If no abandoned carrier can be fetched, it creates a new empty carrier.
When an abandoned carrier has been fetched, it will function as an ordinary carrier. This feature has
special requirements on the allocation strategy used. Only the strategies aoff, aoffcbf, aoffcaobf,
ageffcaoffm, ageffcbf and ageffcaobf support abandoned carriers.
This feature also requires multiple thread specific instances to be enabled. When enabling this
feature, multiple thread-specific instances are enabled if not already enabled, and the aoffcbf
strategy is enabled if the current strategy does not support abandoned carriers. This feature can be
enabled on all allocators based on the alloc_util framework, except temp_alloc (which would be
pointless).
+M<S>acfml<bytes>:
Abandon carrier free block min limit. A valid <bytes> is a positive integer representing a block size
limit. The largest free block in a carrier must be at least bytes large, for the carrier to be
abandoned. The default is zero but can be changed in the future.
See also acul.
+M<S>acnl<amount>:
Abandon carrier number limit. A valid <amount> is a positive integer representing max number of
abandoned carriers per allocator instance. Defaults to 1000 which will practically disable the limit,
but this can be changed in the future.
See also acul.
+M<S>asbf|aobf|aoff|aoffcbf|aoffcaobf|ageffcaoff|ageffcbf|ageffcaobf|gf|af:
Allocation strategy. The following strategies are valid:
* bf (best fit)
* aobf (address order best fit)
* aoff (address order first fit)
* aoffcbf (address order first fit carrier best fit)
* aoffcaobf (address order first fit carrier address order best fit)
* ageffcaoff (age order first fit carrier address order first fit)
* ageffcbf (age order first fit carrier best fit)
* ageffcaobf (age order first fit carrier address order best fit)
* gf (good fit)
* af (a fit)
See the description of allocation strategies in section The alloc_util Framework.
+M<S>asbcst<size>:
Absolute singleblock carrier shrink threshold (in kilobytes). When a block located in an mseg_alloc
singleblock carrier is shrunk, the carrier is left unchanged if the amount of unused memory is less
than this threshold, otherwise the carrier is shrunk. See also rsbcst.
+M<S>atagstrue|false:
Adds a small tag to each allocated block that contains basic information about what it is and who
allocated it. Use the instrument module to inspect this information.
The runtime overhead is one word per allocation when enabled. This may change at any time in the
future.
The default is true for binary_alloc and driver_alloc, and false for the other allocator types.
+M<S>cpB|D|E|F|H||L|R|S|@|::
Set carrier pool to use for the allocator. Memory carriers will only migrate between allocator
instances that use the same carrier pool. The following carrier pool names exist:
B:
Carrier pool associated with binary_alloc.
D:
Carrier pool associated with std_alloc.
E:
Carrier pool associated with ets_alloc.
F:
Carrier pool associated with fix_alloc.
H:
Carrier pool associated with eheap_alloc.
L:
Carrier pool associated with ll_alloc.
R:
Carrier pool associated with driver_alloc.
S:
Carrier pool associated with sl_alloc.
@:
Carrier pool associated with the system as a whole.
Besides passing carrier pool name as value to the parameter, you can also pass :. By passing :
instead of carrier pool name, the allocator will use the carrier pool associated with itself. By
passing the command line argument "+Mucg:", all allocators that have an associated carrier pool will
use the carrier pool associated with themselves.
The association between carrier pool and allocator is very loose. The associations are more or less
only there to get names for the amount of carrier pools needed and names of carrier pools that can be
easily identified by the : value.
This flag is only valid for allocators that have an associated carrier pool. Besides that, there are
no restrictions on carrier pools to use for an allocator.
Currently each allocator with an associated carrier pool defaults to using its own associated carrier
pool.
+M<S>etrue|false:
Enables allocator <S>.
+M<S>lmbcs<size>:
Largest (mseg_alloc) multiblock carrier size (in kilobytes). See the description on how sizes for
mseg_alloc multiblock carriers are decided in section The alloc_util Framework. On 32-bit Unix style
OS this limit cannot be set > 64 MB.
+M<S>mbcgs<ratio>:
(mseg_alloc) multiblock carrier growth stages. See the description on how sizes for mseg_alloc
multiblock carriers are decided in section The alloc_util Framework.
+M<S>mbsd<depth>:
Maximum block search depth. This flag has effect only if the good fit strategy is selected for
allocator <S>. When the good fit strategy is used, free blocks are placed in segregated free-lists.
Each free-list contains blocks of sizes in a specific range. The maxiumum block search depth sets a
limit on the maximum number of blocks to inspect in a free-list during a search for suitable block
satisfying the request.
+M<S>mmbcs<size>:
Main multiblock carrier size. Sets the size of the main multiblock carrier for allocator <S>. The
main multiblock carrier is allocated through sys_alloc and is never deallocated.
+M<S>mmmbc<amount>:
Maximum mseg_alloc multiblock carriers. Maximum number of multiblock carriers allocated through
mseg_alloc by allocator <S>. When this limit is reached, new multiblock carriers are allocated
through sys_alloc.
+M<S>mmsbc<amount>:
Maximum mseg_alloc singleblock carriers. Maximum number of singleblock carriers allocated through
mseg_alloc by allocator <S>. When this limit is reached, new singleblock carriers are allocated
through sys_alloc.
+M<S>ramv<bool>:
Realloc always moves. When enabled, reallocate operations are more or less translated into an
allocate, copy, free sequence. This often reduces memory fragmentation, but costs performance.
+M<S>rmbcmt<ratio>:
Relative multiblock carrier move threshold (in percent). When a block located in a multiblock carrier
is shrunk, the block is moved if the ratio of the size of the freed memory compared to the previous
size is more than this threshold, otherwise the block is shrunk at the current location.
+M<S>rsbcmt<ratio>:
Relative singleblock carrier move threshold (in percent). When a block located in a singleblock
carrier is shrunk to a size smaller than the value of parameter sbct, the block is left unchanged in
the singleblock carrier if the ratio of unused memory is less than this threshold, otherwise it is
moved into a multiblock carrier.
+M<S>rsbcst<ratio>:
Relative singleblock carrier shrink threshold (in percent). When a block located in an mseg_alloc
singleblock carrier is shrunk, the carrier is left unchanged if the ratio of unused memory is less
than this threshold, otherwise the carrier is shrunk. See also asbcst.
+M<S>sbct<size>:
Singleblock carrier threshold (in kilobytes). Blocks larger than this threshold are placed in
singleblock carriers. Blocks smaller than this threshold are placed in multiblock carriers. On 32-bit
Unix style OS this threshold cannot be set > 8 MB.
+M<S>smbcs<size>:
Smallest (mseg_alloc) multiblock carrier size (in kilobytes). See the description on how sizes for
mseg_alloc multiblock carriers are decided in section The alloc_util Framework.
+M<S>ttrue|false:
Multiple, thread-specific instances of the allocator. Default behavior is NoSchedulers+1 instances.
Each scheduler uses a lock-free instance of its own and other threads use a common instance.
Before ERTS 5.9 it was possible to configure a smaller number of thread-specific instances than
schedulers. This is, however, not possible anymore.
FlagsforConfigurationofalloc_util
All allocators based on alloc_util are effected.
+Muycs<size>:
sys_alloc carrier size. Carriers allocated through sys_alloc are allocated in sizes that are
multiples of the sys_alloc carrier size. This is not true for main multiblock carriers and carriers
allocated during a memory shortage, though.
+Mummc<amount>:
Maximum mseg_alloc carriers. Maximum number of carriers placed in separate memory segments. When this
limit is reached, new carriers are placed in memory retrieved from sys_alloc.
+Musac<bool>:
Allow sys_alloc carriers. Defaults to true. If set to false, sys_alloc carriers are never created by
allocators using the alloc_util framework.
SpecialFlagforliteral_alloc+MIscs<sizeinMB>:
literal_alloc super carrier size (in MB). The amount of virtual address space reserved for literal
terms in Erlang code on 64-bit architectures. Defaults to 1024 (that is, 1 GB), which is usually
sufficient. The flag is ignored on 32-bit architectures.
InstrumentationFlags+M<S>atags:
Adds a small tag to each allocated block that contains basic information about what it is and who
allocated it. See +M<S>atags for a more complete description.
+MitX:
Reserved for future use. Do not use this flag.
Note:
When instrumentation of the emulator is enabled, the emulator uses more memory and runs slower.
OtherFlags+Meamin|max|r9c|r10b|r11b|config:
Options:
min:
Disables all allocators that can be disabled.
max:
Enables all allocators (default).
r9c|r10b|r11b:
Configures all allocators as they were configured in respective Erlang/OTP release. These will
eventually be removed.
config:
Disables features that cannot be enabled while creating an allocator configuration with
erts_alloc_config(3erl).
Note:
This option is to be used only while running erts_alloc_config(3erl), not when using the created
configuration.
+Mlpmall|no:
Lock physical memory. Defaults to no, that is, no physical memory is locked. If set to all, all
memory mappings made by the runtime system are locked into physical memory. If set to all, the
runtime system fails to start if this feature is not supported, the user has not got enough
privileges, or the user is not allowed to lock enough physical memory. The runtime system also fails
with an out of memory condition if the user limit on the amount of locked memory is reached.
+Mdaimax|<amount>:
Set amount of dirty allocator instances used. Defaults to 0. That is, by default no instances will be
used. The maximum amount of instances equals the amount of dirty CPU schedulers on the system.
By default, each normal scheduler thread has its own allocator instance for each allocator. All other
threads in the system, including dirty schedulers, share one instance for each allocator. By enabling
dirty allocator instances, dirty schedulers will get and use their own set of allocator instances.
Note that these instances are not exclusive to each dirty scheduler, but instead shared among dirty
schedulers. The more instances used the less risk of lock contention on these allocator instances.
Memory consumption do however increase with increased amount of dirty allocator instances.