That’s it. Your machine has about a singe GiB of ram, ~850 MiB of it are currently available. So your message in the OP said it wasn’t able to allocate about 400 MiB. Taking into account that there might have been other processes taking up memory as well and also stuff in the bin_heap, I can say for sure, that your machine has not enough memory to build at least that library ex_phone_number.
Try to build your application locally into a release, embed the ERTS and deploy the archive.
Alternatively, stock up the memory of your machine. Perhaps you can stock to 4 GiB for build and lower back to 1 GiB during run time through AWS interface? I heard you can manage your instances “flexible” there, but I’m not sure what it means. I haven’t worked with AWS or similar services so far…
Try to build your application locally into a release, embed the ERTS and deploy the archive.
Thumbs up! That is the way to do it. Building software can usually be
memory hungry (and I think building releases especially (and dialyzer))
so you really want to build locally and then deploy on yoru AWS
AWS runs on 64bit linux and we do not know anything about the OPs system. Maybe he is running on windows, arm, or 32bit (or even combinations thereof). And especially the last two things do make it near to impossible to prepare the release locally.
Yeah, it looks like ex_phone_number is really hungry for memory during compilation Elixir 1.5 should use a bit less memory during compilation (and compile faster), but I’m not sure it’s going to matter here.