You cannot use the standard installation procedure, as even compiling will most likely produce code that crashes later on. Same applies to loading the data.
I put together a comprehensive guide for Raspberry PI 2, which you could use as a baseline: https://wiki.openstreetmap.org/wiki/User:Mmd/Overpass_API/Raspberry
You should use the source code http://dev.overpass-api.de/releases/osm-3s_v0.7.55.tar.gz as mentioned in the official guide. Also, be sure to change the configure options to
./configure CXXFLAGS="-Og -g -fno-omit-frame-pointer -march=native"
otherwise you will get random segmentation faults later on due to unaligned memory accesses (!).
For the update_database command, it's essential to limit the memory consumption by using --flush-size=1
, otherwise this process will consume too much memory and will crash.
512MB is really a very limited amount of memory, it might still not be enough in your case.