[erlang-questions] Pre-allocating memory

Mikael Pettersson mikpelinux@REDACTED
Mon Nov 6 16:13:36 CET 2017


By default mmap() only sets up address space, but doesn't necessarily bind
that address space to actual RAM.  Normally that binding is populated "on
demand" via page faults.  (There are various flags to mmap() to modify this
behaviour.)

Perhaps check if /proc/$pid/maps contains an 8GB anonymous mapping? (where
$pid is the pid of your beam process)

On Mon, Nov 6, 2017 at 7:10 AM, Rick Payne <rickp@REDACTED> wrote:

>
> I'm running the beam under OSv - a unikernel that tries to be ABI
> compatible with Linux, modulo a few things (such as no fork).
> Unfortunately, I'm seeing lots of memory fragmentation with my workload,
> probably due to issues in OSv's memory management.
>
> I had thought there was a way to get erlang to preallocate memory in
> advance using super-carriers, such that i could then rely on the beam to
> manage memory and hopefully not suffer the same fragmentation issues.
> However, I am failing to make this work.
>
> From my reading of the erts_alloc page, I have tried setting +MMscs to
> 8192 (as I want to allocate 8GB). This doesn't seem to happen (looking at
> the OSv stats - the memory isn't allocated). Have I misunderstood?
>
> It could also be that some facilities are not supported by OSv (but it
> does support mmap for instance) - so a pointer as to what to check would be
> most useful.
>
> Cheers,
> Rick
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20171106/1ae4ca91/attachment.htm>


More information about the erlang-questions mailing list