erts_alloc_config(3erl)
π erts_alloc_config π
okay bestie, we're in erts_alloc_config(3erl) territory β that's the module definition straight out of the Erlang docs, and she's a lot, but I got you π«Ά
β¨ NAME β¨
erts_alloc_config β the configuration tool for erts_alloc, no cap π
πΈ DESCRIPTION πΈ
Warning: this (experimental) tool no longer produces good configurations and cannot be fixed in a reasonably backwards compatible manner. It has therefore been scheduled for removal in OTP 26.0. bestie. she's literally on the way out π
So like, erts_alloc(3erl) is the Erlang Run-Time System internal memory allocator library, right? And erts_alloc_config is meant to help you create an erts_alloc(3erl) configuration that's suitable for a limited number of runtime scenarios. The config that erts_alloc_config produces is intended as a suggestion, and it may need to be adjusted manually. it's giving "draft, not final draft" β¨
The configuration gets created based on information about a number of runtime scenarios. And likeβ¦ it is obviously impossible to foresee every runtime scenario that can occur, bestie, let's be real π The important scenarios are the ones that cause maximum or minimum load on specific memory allocators. And "load" here means total size of memory blocks allocated.
The current implementation of erts_alloc_config concentrates on configuration of multi-block carriers. The information gathered when a runtime scenario is saved is mainly current and maximum use of multi-block carriers. So if a parameter that changes the use of multi-block carriers gets changed, a previously generated configuration is invalid and erts_alloc_config needs to be run again. It's mainly the single block carrier threshold that affects the use of multi-block carriers, but other single-block carrier parameters might as well. And if you want another value of a single block carrier parameter than the default? Use the desired value when running erts_alloc_config. periodt π
A configuration is created in the following way:
- Pass the
+Mea configcommand-line flag to the Erlang runtime system you're going to use for creation of the allocator configuration. It will disable features that preventerts_alloc_configfrom doing its job. Note: you should not use this flag when using the created configuration. Also note that it's important that you use the same amount of schedulers when creating the configuration as you're going to use on the system using the configuration. same energy or it's cooked π₯ - Run your applications with different scenarios (the more the better) and save information about each scenario by calling
save_scenario/0. It may be hard to know when the applications are at an (forerts_alloc_config) important runtime scenario. A good approach may therefore be to callsave_scenario/0repeatedly, e.g. once every tenth second. Note: it's important that your applications reach the runtime scenarios that are important forerts_alloc_configwhen you're saving scenarios; otherwise, the configuration may perform bad π - When you've covered all scenarios, call
make_config/1in order to create a configuration. The configuration is written to a file that you have chosen. This configuration file can later be read by an Erlang runtime-system at startup. Pass the command line argument-args_file FileNameto theerl(1)command. π - The configuration produced by
erts_alloc_configmay need to be manually adjusted as already stated. Do not modify the file produced byerts_alloc_config; instead, put your modifications in another file and load this file after the file produced byerts_alloc_config. That is, put the-args_file FileNameargument that reads your modification file later on the command-line than the-args_file FileNameargument that reads the configuration file produced byerts_alloc_config. If a memory allocation parameter appear multiple times, the last version of will be used, i.e., you can override parameters in the configuration file produced byerts_alloc_config. Doing it this way simplifies things when you want to rerunerts_alloc_config. lowkey genius honestly π§
Note: the configuration created byerts_alloc_configmay perform bad, ever horrible, for runtime scenarios that are very different from the ones saved when creating the configuration. You are, therefore, advised to rerunerts_alloc_configif the applications run when the configuration was made are changed, or if the load on the applications have changed since the configuration was made. You're also advised to rerunerts_alloc_configif the Erlang runtime system used is changed. π
erts_alloc_config saves information about runtime scenarios and performs computations in a server that is automatically started. The server register itself under the name '__erts_alloc_config__'. she has a name and she's iconic for it π
π EXPORTS π
β save_scenario() -> ok | {error, Error}
Types:
Error = term()
save_scenario/0 saves information about the current runtime scenario. This information will later be used when make_config/0, or make_config/1 is called.
The first time save_scenario/0 is called a server will be started. This server will save runtime scenarios. All saved scenarios can be removed by calling stop/0. bye bestie π
β make_config() -> ok | {error, Error}
Types:
Error = term()
This is the same as calling make_config(group_leader()). fr fr π«Ά
β make_config(FileNameOrIODev) -> ok | {error, Error}
Types:
FileNameOrIODev = string() | io_device()
Error = term()
make_config/1 uses the information previously saved by save_scenario/0 in order to produce an erts_alloc configuration. At least one scenario have had to be saved. All scenarios previously saved will be used when creating the configuration. no scenario, no config, them's the rules β¨
If FileNameOrIODev is a string(), make_config/1 will use FileNameOrIODev as a filename. A file named FileNameOrIODev is created and the configuration will be written to that file. If FileNameOrIODev is an io_device() (see the documentation of the module io), the configuration will be written to the io device. either way she's writing it π
β stop() -> ok | {error, Error}
Types:
Error = term()
Stops the server that saves runtime scenarios. that's it, that's the whole thing π
π¦ SEE ALSO π¦
erts_alloc(3erl), erl(1), io(3erl)
and that's the whole page bestie!! π this one came from Ericsson AB, tagged as runtime_tools 1.19 β go off, queens πβ¨
π¦ where this page comes from
- debian bookworm: erlang-manpages 1:25.2.3+dfsg-1+deb12u1 Β· Apache-2.0
- debian bookworm: erlang-manpages 1:25.2.3+dfsg-1+deb12u4 Β· Apache-2.0
- ubuntu noble: erlang-manpages 1:25.3.2.8+dfsg-1ubuntu4 Β· Apache-2.0
- ubuntu noble: erlang-manpages 1:25.3.2.8+dfsg-1ubuntu4.8 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms