3
votes


I've been trying to install Open Source Routing Machine(OSRM) on an Ubuntu server but when I run Make in the build folder it stops at 21% and gives me the following error:

[ 21%] Building CXX object CMakeFiles/OSRM.dir/Library/OSRM_impl.cpp.o

virtual memory exhausted: Cannot allocate memory

make[2]: * [CMakeFiles/OSRM.dir/Library/OSRM_impl.cpp.o] Error 1

make[1]: * [CMakeFiles/OSRM.dir/all] Error 2

make: * [all] Error 2

$

I've looked all over for a solution online and found suggestions on changing ulimit and adding swap memory neither of which have worked for me. Any help would be much appreciated!

EDIT: I contacted the OSRM developers and it turns out I needed 2.5 GB of ram. I only had 1. I got around this issue by adding a swap file following these instructions: http://digitizor.com/2011/02/06/create-swap-file-ubuntu-linux/

1
what is the output for ulimit -v ? - Piotr Skotnicki
First question is whether it really needs more memory than you have or whether same kind of bug causes it to exceed limits. Use e.g. htop to watch the processes on your machine, does one of them reach the actual memory limits of your system? If so, you might get away with fiddling with compiler options (e.g. turning off debug symbols and optimization). Also interesting would be the actual commandline that make generates. - Ulrich Eckhardt
What is the output of free on your system? - thkala

1 Answers

2
votes

Many Virtual Servers such as AWS do not provide any swap space by default. You may find that adding a 4GB swap will resolve the issue. To do this use an approach such as that described at https://www.digitalocean.com/community/tutorials/how-to-add-swap-on-ubuntu-14-04