Skip to content

Commit fc348d7

Browse files
authored
Fix typo in code anti-patterns doc (#14221)
The paragraph preceding the change mentions two reasons (atoms aren't garbage collected, and the Erlang VM limits the number of atoms).
1 parent 5610775 commit fc348d7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/elixir/pages/anti-patterns/code-anti-patterns.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ end
141141

142142
An `Atom` is an Elixir basic type whose value is its own name. Atoms are often useful to identify resources or express the state, or result, of an operation. Creating atoms dynamically is not an anti-pattern by itself. However, atoms are not garbage collected by the Erlang Virtual Machine, so values of this type live in memory during a software's entire execution lifetime. The Erlang VM limits the number of atoms that can exist in an application by default to *1_048_576*, which is more than enough to cover all atoms defined in a program, but attempts to serve as an early limit for applications which are "leaking atoms" through dynamic creation.
143143

144-
For these reason, creating atoms dynamically can be considered an anti-pattern when the developer has no control over how many atoms will be created during the software execution. This unpredictable scenario can expose the software to unexpected behavior caused by excessive memory usage, or even by reaching the maximum number of *atoms* possible.
144+
For these reasons, creating atoms dynamically can be considered an anti-pattern when the developer has no control over how many atoms will be created during the software execution. This unpredictable scenario can expose the software to unexpected behavior caused by excessive memory usage, or even by reaching the maximum number of *atoms* possible.
145145

146146
#### Example
147147

0 commit comments

Comments
 (0)