Permalink
Browse files

Changing memory allocation settings for binaries

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...
1 parent 945a091 commit b2d9ffd06086e8e1830317f8a2e9b87fb495a7ab @ferd ferd committed Sep 5, 2013
Showing with 1 addition and 1 deletion.
  1. +1 −1 bin/logplex
View
2 bin/logplex
@@ -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.