Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/okeuday/erlang_term
Erlang Term Info
https://github.com/okeuday/erlang_term
data-structures erlang memory-consumption
Last synced: 3 months ago
JSON representation
Erlang Term Info
- Host: GitHub
- URL: https://github.com/okeuday/erlang_term
- Owner: okeuday
- License: mit
- Created: 2014-09-26T18:15:10.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2024-02-17T00:22:16.000Z (11 months ago)
- Last Synced: 2024-10-18T03:35:39.847Z (3 months ago)
- Topics: data-structures, erlang, memory-consumption
- Language: Erlang
- Size: 91.8 KB
- Stars: 33
- Watchers: 6
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.markdown
- License: LICENSE
Awesome Lists containing this project
- freaking_awesome_elixir - Erlang - Provide the in-memory size of Erlang terms, ignoring where these are stored. (Miscellaneous)
- fucking-awesome-elixir - erlang_term - Provide the in-memory size of Erlang terms, ignoring where these are stored. (Miscellaneous)
- beamtoolbox - [erl
- awesome-elixir - erlang_term - Provide the in-memory size of Erlang terms, ignoring where these are stored. (Miscellaneous)
README
Erlang Term Info (Memory Consumption)
=====================================[![Build Status](https://app.travis-ci.com/okeuday/erlang_term.svg?branch=master)](https://app.travis-ci.com/okeuday/erlang_term)
Purpose
-------To provide the in-memory size of Erlang terms, ignoring where the Erlang terms
are stored.Size information should match the [Erlang Efficiency Guide memory information](http://www.erlang.org/doc/efficiency_guide/advanced.html#id68923):
* Small integer: 1 word
* On 32-bit architectures: -134217729 < i < 134217728 (28 bits)
* On 64-bit architectures: -576460752303423489 < i < 576460752303423488 (60 bits)
* Big integer: 3..N words
* Atom: 1 word
* Float:
* On 32-bit architectures: 4 words
* On 64-bit architectures: 3 words
* Binary: 3..6 + data
* List: 1 word + 1 word per element + the size of each element
* Tuple: 2 words + the size of each element
* Small Map (N =< 32): 5 words + the size of all keys and values
* Large Map (N > 32): N * [1.6 .. 1.8] + the size of all keys and values
* Pid:
* From local node: 1 word
* From remote node: 5 words
* Port:
* From local node: 1 word
* From remote node: 5 words
* Reference:
* On 32-bit architectures:
* From local node: 5 words
* From remote node: 7 words
* On 64-bit architectures:
* From local node: 4 words
* From remote node: 6 words
* Fun: 9..13 words + size of environment
* Erlang process: 338 words when spawned (includes a heap of 233 words)Limitations
-----------* Binaries are not tracked to avoid counting a reference more than once
(to avoid the extra latency and memory use)License
-------MIT License
Contact
-------Michael Truog (mjtruog at protonmail dot com)
Thanks
------* Sverker Eriksson [`erts_debug:flat_size/1` info](erlang_bugs_email.txt)