Skip to content
This repository has been archived by the owner on Sep 27, 2023. It is now read-only.

Commit

Permalink
Changing memory allocation settings for binaries
Browse files Browse the repository at this point in the history
Changing the allocator strategy for binary_alloc to do aobf rather than
bf (+MBas aobf). Depending on how all of the binaries are allocated,
this could make new allocations favor the same carrier. This will only
add a small cpu overhead when allocating new binaries. This could
however worsen our utilization even more if we are unlucky, it will
however make allocations faster and more in the same area in the
expected case, which should reduce fragmentation and untraceable leaks.

We're also decreasing the size of our mbcs. Right now we have smbcs set
to 256 kb and lmbcs at 5 MB (rounded up to 8MB as ERTS only allocates
multiples of 2) and an average multi-block carrier size of 7.78 MB. We
try to set +MBlmbcs 512 so that we get many more carriers and
thus increase the chance that it can be returned to the OS.

These two options have been recommended by members of the Erlang/OTP
team to reduce the passive memory leaks due to allocation patterns
compared to our peculiar use cases for log messages.
  • Loading branch information
ferd committed Sep 5, 2013
1 parent 945a091 commit b2d9ffd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion bin/logplex
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/sh

erl +K true +A100 +P500000 -env ERL_MAX_PORTS 65535 -config sys -name logplex@`hostname --fqdn` -pa ebin -env ERL_LIBS deps -noshell -noinput -s logplex_app -setcookie ${LOGPLEX_COOKIE}
erl +K true +A100 +P500000 -env ERL_MAX_PORTS 65535 -config sys -name logplex@`hostname --fqdn` -pa ebin -env ERL_LIBS deps -noshell -noinput -s logplex_app -setcookie ${LOGPLEX_COOKIE} +MBas aobf +MBlmbcs 512

0 comments on commit b2d9ffd

Please sign in to comment.