diff options
author | Björn Gustavsson <[email protected]> | 2019-04-02 09:55:56 +0200 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2019-04-04 12:30:20 +0200 |
commit | 2d9570e3c54ffd42915b8e20aaa194a675ef2f9c (patch) | |
tree | e291d1ee5be1dfdeec33549b892bd2100ebdda68 /erts/emulator/internal_doc/GarbageCollection.md | |
parent | 2d9f2307e51606e6234f1ed18d8ba3a7569e38db (diff) | |
download | otp-2d9570e3c54ffd42915b8e20aaa194a675ef2f9c.tar.gz otp-2d9570e3c54ffd42915b8e20aaa194a675ef2f9c.tar.bz2 otp-2d9570e3c54ffd42915b8e20aaa194a675ef2f9c.zip |
Fix minor typos
Diffstat (limited to 'erts/emulator/internal_doc/GarbageCollection.md')
-rw-r--r-- | erts/emulator/internal_doc/GarbageCollection.md | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/erts/emulator/internal_doc/GarbageCollection.md b/erts/emulator/internal_doc/GarbageCollection.md index c15e5738b1..a1627b3233 100644 --- a/erts/emulator/internal_doc/GarbageCollection.md +++ b/erts/emulator/internal_doc/GarbageCollection.md @@ -33,7 +33,7 @@ Compiling this code to beam assembly (`erlc -S`) shows exactly what is happening {put,{literal,{text,"hello world!"}}}. return. -Looking at the assembler code we can see three things; The heap requirement in this function turns out to be only six words, as seen by the `{test_heap,6,1}` instruction. All the allocations are combined to a single instruction. The bulk of the data `{text, "hello world!"}` is a *literal*. Literals, sometimes referred to as constants, are not allocated in the function since they are a part of the module and allocated at load time. +Looking at the assembler code we can see three things: The heap requirement in this function turns out to be only six words, as seen by the `{test_heap,6,1}` instruction. All the allocations are combined to a single instruction. The bulk of the data `{text, "hello world!"}` is a *literal*. Literals, sometimes referred to as constants, are not allocated in the function since they are a part of the module and allocated at load time. If there is not enough space available on the heap to satisfy the `test_heap` instructions request for memory, then a garbage collection is initiated. It may happen immediately in the `test_heap` instruction, or it can be delayed until a later time depending on what state the process is in. If the garbage collection is delayed, any memory needed will be allocated in heap fragments. Heap fragments are extra memory blocks that are a part of the young heap, but are not allocated in the contigious area where terms normally reside. See [The young heap](#the-young-heap) for more details. @@ -89,7 +89,7 @@ To reclaim data from the old heap, both young and old heaps are included during ## The young heap -The young heap, or the allocation heap, consists of the stack and heap as described in the Overview. However, it also includes any heap fragments that are attached to the heap. All of the heap fragments are considered to be above the high-watermark and part of the young generation. Heap fragments contain terms that either did not fit on the heap, or were created by another process and then attached to the heap. For instance if the bif binary_to_term created a term which does not fit on the current heap without doing a garbage collection, it will create a heap-fragment for the term and then schedule a garbage collection for later. Also if a message is sent to the process, the payload may be placed in a heap-fragment and that fragment is added to young heap when the message is matched in a receive clause. +The young heap, or the allocation heap, consists of the stack and heap as described in the Overview. However, it also includes any heap fragments that are attached to the heap. All of the heap fragments are considered to be above the high-watermark and part of the young generation. Heap fragments contain terms that either did not fit on the heap, or were created by another process and then attached to the heap. For instance if the bif `binary_to_term/1` created a term which does not fit on the current heap without doing a garbage collection, it will create a heap-fragment for the term and then schedule a garbage collection for later. Also if a message is sent to the process, the payload may be placed in a heap-fragment and that fragment is added to young heap when the message is matched in a receive clause. This procedure differs from how it worked prior to Erlang/OTP 19.0. Before 19.0, only a contiguous memory block where the young heap and stack resided was considered to be part of the young heap. Heap fragments and messages were immediately copied into the young heap before they could be inspected by the Erlang program. The behaviour introduced in 19.0 is superior in many ways - most significantly it reduces the number of necessary copy operations and the root set for garbage collection. |