Skip to content

Conversation

michalmuskala
Copy link
Contributor

In particular, this includes the full original binary and all the references. Gathering this information requires full heap traversal, so is fairly expensive - that's why we keep both the existing binary and this new API.

Example:

1> A = <<0:(1024*8)>>.
2> <<B:550/bitstring,D:550/bits,E:550/bits,C/bitstring>> = A.
3> erlang:process_info(self(),[binary_full]).
[{binary_full,[{126812357133856,1024,1,
           <<0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,...>>,
           [{1100,1650},{550,1100},{1650,8192},{0,550},{0,8192}]}]}]

Original draft implementation by @garazdawi in garazdawi@d5a2c6f.

Copy link
Contributor

github-actions bot commented Oct 7, 2025

CT Test Results

    3 files    135 suites   49m 9s ⏱️
1 651 tests 1 594 ✅ 57 💤 0 ❌
2 287 runs  2 211 ✅ 76 💤 0 ❌

Results for commit 44c22ec.

♻️ This comment has been updated with latest results.

To speed up review, make sure that you have read Contributing to Erlang/OTP and that all checks pass.

See the TESTING and DEVELOPMENT HowTo guides for details about how to run test locally.

Artifacts

// Erlang/OTP Github Action Bot

@michalmuskala michalmuskala force-pushed the binary-full branch 5 times, most recently from eb25eca to 1ca8340 Compare October 7, 2025 12:07
In particular, this includes the full original binary and all the references.
Gathering this information requires full heap traversal, so is fairly expensive -
that's why we keep both the existing `binary` and this new API.

Example:

```
1> A = <<0:(1024*8)>>.
2> <<B:550/bitstring,D:550/bits,E:550/bits,C/bitstring>> = A.
3> erlang:process_info(self(),[binary_full]).
[{binary_full,[{126812357133856,1024,1,
           <<0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,...>>,
           [{1100,1650},{550,1100},{1650,8192},{0,550},{0,8192}]}]}]
```

Co-authored-by: Lukas Backström <[email protected]>
@IngelaAndin IngelaAndin added the team:VM Assigned to OTP team VM label Oct 13, 2025
@jhogberg jhogberg self-assigned this Oct 13, 2025
Copy link
Contributor

@jhogberg jhogberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR! I've left some comments below.

@michalmuskala
Copy link
Contributor Author

Thank you for the review. I pushed an update addressing your comments.
I also moved the read of the reference count to happen before we bump it, so we don't need to later decrease it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

team:VM Assigned to OTP team VM

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants