# \#binary

**URL:** https://erlangforums.com/tag/binary/412.md

[Latest](https://erlangforums.com/latest.md) · [Categories](https://erlangforums.com/categories.md) · [Tags](https://erlangforums.com/tags.md)

---

## [EEP: Singleton Binary Literal Types](https://erlangforums.com/t/eep-singleton-binary-literal-types/5481)

<div class="topic-metadata">

**Author:** [@williamthome](https://erlangforums.com/u/williamthome)\
**Replies:** 2\
**Last updated:** [October 28, 2026, 5:23pm UTC](https://erlangforums.com/t/eep-singleton-binary-literal-types/5481 "2026-10-28T17:23:33Z")

</div>

This EEP extends EEP 8 to allow binary literals such as \<\<"start"\>\> and \<\<"stop"\>\> as singleton types in -type, -spec, -callback, and record field type declarations. It also supports encoding annotations (\<\<"café"/utf8\>\>)…

---

## [Binary packet definition languages](https://erlangforums.com/t/binary-packet-definition-languages/4957)

<div class="topic-metadata">

**Author:** [@gorenje](https://erlangforums.com/u/gorenje)\
**Replies:** 11\
**Last updated:** [August 11, 2025, 12:08am UTC](https://erlangforums.com/t/binary-packet-definition-languages/4957 "2025-08-11T00:08:03Z")

</div>

Hi There, Working on the Erlang-Red and specifically an MQTT emulation flow, I noticed how simple yet complicate binary definitions in Erlang are: \<\<\_:8/bits, 1:1, Len:7/bits, 1:1, Len2:7/bits, 1:1, Len3:7/bits, 0:1, L…

---

## [Erlang reports much less memory allocated than OS](https://erlangforums.com/t/erlang-reports-much-less-memory-allocated-than-os/4462)

<div class="topic-metadata">

**Author:** [@fpxu](https://erlangforums.com/u/fpxu)\
**Replies:** 5\
**Last updated:** [February 11, 2025, 2:50am UTC](https://erlangforums.com/t/erlang-reports-much-less-memory-allocated-than-os/4462 "2025-02-11T02:50:36Z")

</div>

Hi there I have an application to broadcast messages to many remote clients, when doing the performance testing that delivering large messages, I encountered an OOM issue. Message flow: Message → pre-process genserver…

---

## [Binary (or String) interpolation](https://erlangforums.com/t/binary-or-string-interpolation/2940)

<div class="topic-metadata">

**Author:** [@carlotm](https://erlangforums.com/u/carlotm)\
**Replies:** 17\
**Last updated:** [October 13, 2023, 6:30am UTC](https://erlangforums.com/t/binary-or-string-interpolation/2940 "2023-10-13T06:30:53Z")

</div>

Hi all, I would like to interpolate a string or a binary. I’d like to get: "Some Foo text" or \<\<"Some Foo text"\>\> Given X = "Foo" or X = \<\<"Foo"\>\> This snippet is working: X = "Foo", Result = lists:flatten(io\_lib:fo…

---

## [Need help trying to parse a complex binary protocol, getting: Warning: BINARY CREATED: binary is returned from the function](https://erlangforums.com/t/need-help-trying-to-parse-a-complex-binary-protocol-getting-warning-binary-created-binary-is-returned-from-the-function/2877)

<div class="topic-metadata">

**Author:** [@zabrane](https://erlangforums.com/u/zabrane)\
**Replies:** 9\
**Last updated:** [September 15, 2023, 12:00pm UTC](https://erlangforums.com/t/need-help-trying-to-parse-a-complex-binary-protocol-getting-warning-binary-created-binary-is-returned-from-the-function/2877 "2023-09-15T12:00:37Z")

</div>

Hi guys I’m trying to parse a complex binary protocol but for the sake of simplicity, this is my problem: 01. -module(protocol). 02. -export(\[ parse1/1, parse2/1 \]). 03. 04. parse1(\<\<$a, Rest/binary\>\>) -\> 05. %% ca…

---

## [Decrementing a Binary Reference Count](https://erlangforums.com/t/decrementing-a-binary-reference-count/2191)

<div class="topic-metadata">

**Author:** [@joseph](https://erlangforums.com/u/joseph)\
**Replies:** 1\
**Last updated:** [December 19, 2022, 10:21pm UTC](https://erlangforums.com/t/decrementing-a-binary-reference-count/2191 "2022-12-19T22:21:57Z")

</div>

I have read that when a process is done with a binary (it doesn’t bind it to a variable), the reference count is decremented. I’m not sure I understand what that means. I have a gen\_server that receives a message with …

---

## [Size differences between iolists and binaries](https://erlangforums.com/t/size-differences-between-iolists-and-binaries/2083)

<div class="topic-metadata">

**Author:** [@ruslandoga](https://erlangforums.com/u/ruslandoga)\
**Replies:** 1\
**Last updated:** [November 28, 2022, 5:12pm UTC](https://erlangforums.com/t/size-differences-between-iolists-and-binaries/2083 "2022-11-28T17:12:36Z")

</div>

:wave: I’m trying to understand what causes memory usage differences between equivalent iolists and binaries, in particular, when stored into ets. Is the x4 memory usage caused just by linked list references? Or is t…

---

## [Why is the refc\_binary reference invalid](https://erlangforums.com/t/why-is-the-refc-binary-reference-invalid/1797)

<div class="topic-metadata">

**Author:** [@dong50252409](https://erlangforums.com/u/dong50252409)\
**Replies:** 5\
**Last updated:** [August 31, 2022, 8:06am UTC](https://erlangforums.com/t/why-is-the-refc-binary-reference-invalid/1797 "2022-08-31T08:06:43Z")

</div>

Hi all I create a refc\_binary Bin1 and then create a sub\_binary Bin2 with Bin1 mix some bits I thought Bin2’s erl\_sub\_bin-\>orig should refer to Bin1’s address but I was wrong Did I do something wrong erl test\_4() -\> …

---

## [Pre-allocate large binary](https://erlangforums.com/t/pre-allocate-large-binary/1323)

<div class="topic-metadata">

**Author:** [@mpope](https://erlangforums.com/u/mpope)\
**Replies:** 2\
**Last updated:** [April 18, 2022, 5:09pm UTC](https://erlangforums.com/t/pre-allocate-large-binary/1323 "2022-04-18T17:09:36Z")

</div>

I need to assemble a very large binary from sub-binaries and I want to avoid copying the smaller binaries every time. In my scenario I know the size of the final binary before assembling. My ‘long term’ goal is to pass a…
