summaryrefslogtreecommitdiff
path: root/lib/stdlib/test/shell_docs_SUITE_data/unknown_erlang_memory_0_func.txt
blob: e440dfd550b2a6d1750d07e06b9e622947b62667 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126

  -spec erlang:memory() -> [{Type, Size}]
                         when
                             Type :: memory_type(),
                             Size :: non_neg_integer().

  Types:
    -type memory_type() ::
          total | processes | processes_used | system | atom |
          atom_used | binary | code | ets.

  Returns a list with information about memory dynamically allocated
  by the Erlang emulator. Each list element is a tuple {Type, Size}.
  The first element Type is an atom describing memory type. The
  second element Size is the memory size in bytes.

  Memory types:

  total:
    The total amount of memory currently allocated. This is the
    same as the sum of the memory size for processes and system.

  processes:
    The total amount of memory currently allocated for the Erlang
    processes.

  processes_used:
    The total amount of memory currently used by the Erlang
    processes. This is part of the memory presented as processes
    memory.

  system:
    The total amount of memory currently allocated for the
    emulator that is not directly related to any Erlang process.
    Memory presented as processes is not included in this
    memory. instrument(3) can be used to get a more detailed
    breakdown of what memory is part of this type.

  atom:
    The total amount of memory currently allocated for atoms. This
    memory is part of the memory presented as system memory.

  atom_used:
    The total amount of memory currently used for atoms. This
    memory is part of the memory presented as atom memory.

  binary:
    The total amount of memory currently allocated for binaries.
    This memory is part of the memory presented as system
    memory.

  code:
    The total amount of memory currently allocated for Erlang
    code. This memory is part of the memory presented as system
    memory.

  ets:
    The total amount of memory currently allocated for ETS tables.
    This memory is part of the memory presented as system
    memory.

  low:
    Only on 64-bit halfword emulator. The total amount of memory
    allocated in low memory areas that are restricted to < 4 GB,
    although the system can have more memory.

    Can be removed in a future release of the halfword emulator.

  maximum:
    The maximum total amount of memory allocated since the
    emulator was started. This tuple is only present when the
    emulator is run with instrumentation.

    For information on how to run the emulator with
    instrumentation, see instrument(3) and/or erl(1).

  Note:
    The system value is not complete. Some allocated memory that
    is to be part of this value is not.

    When the emulator is run with instrumentation, the system
    value is more accurate, but memory directly allocated for 
    malloc (and friends) is still not part of the system value.
    Direct calls to malloc are only done from OS-specific
    runtime libraries and perhaps from user-implemented Erlang
    drivers that do not use the memory allocation functions in the
    driver interface.

    As the total value is the sum of processes and system,
    the error in system propagates to the total value.

    The different amounts of memory that are summed are not
    gathered atomically, which introduces an error in the result.

  The different values have the following relation to each other.
  Values beginning with an uppercase letter is not part of the
  result.

    total      = processes + system
    processes  = processes_used + ProcessesNotUsed
    system     = atom + binary + code + ets + OtherSystem
    atom       = atom_used + AtomNotUsed
    RealTotal  = processes + RealSystem
    RealSystem = system + MissedSystem

  More tuples in the returned list can be added in a future release.

  Note:
    The total value is supposed to be the total amount of memory
    dynamically allocated by the emulator. Shared libraries, the
    code of the emulator itself, and the emulator stacks are not
    supposed to be included. That is, the total value is not
    supposed to be equal to the total size of all pages mapped to
    the emulator.

    Also, because of fragmentation and prereservation of memory
    areas, the size of the memory segments containing the
    dynamically allocated memory blocks can be much larger than
    the total size of the dynamically allocated memory blocks.

  Note:
    As from ERTS 5.6.4, erlang:memory/0 requires that all 
    erts_alloc(3) allocators are enabled (default behavior).

  Failure: notsup if an erts_alloc(3) allocator has been
  disabled.