Error "virtual space exhausted" after cloning the hector_slam package.
Hi everyone,
I'm getting catkinmake error virtual space exhausted
after cloning the `hectorslam` package.
I'm trying to install hector slam package on ubuntu mate 16 with ros kinetic on a raspberry pi 3B. It gets stuck at around 88% every time and gets too hot.
Asked by sajal on 2019-05-30 00:13:56 UTC
Answers
It happens because you are overusing the CPU(and its ram) . Append -j1
or -j2
after catkin_make
to use fewer cores. This will compile slower but at least it won't make your Rpi freeze.
catkin_make -j2
EDIT The best way, in my opinion is Cross Compilation. Once, setup an environment on your pc(there are many tutorials for cross compiling for rpi) and also install minimal ros in that environment. Then just cross compile packages whenever you want with:
catkin_make install
and just copy the install
directory into your rpi's workspace and source the file that is inside of it. For instance:
source ~/catkin_ws/install/setup.bash
Here's an also complete tutorial for cross compiling for Rpi with ROS: https://github.com/HesselM/rpicross_notes
Asked by Orhan on 2019-05-30 07:58:28 UTC
Comments
@orhan Hi, I have tried -j1, -j2, -j3 all. But none of them works. My raspberry pi gets hot and hangs every time. By the way, I'm using Ubuntu Mate 16 + ROS Kinetic image provided by ubiquity robotics on my raspberry pi 3B. Is the issue with R_pi3 getting hot or compatibility of Ubuntu Mate?
Asked by sajal on 2019-05-31 12:11:33 UTC
This is not caused by over using the CPU, but exhausting the available memory. Reducing the number of threads using the-J
option will reduce the memory footprint but not by enough in this case it seems.
Asked by PeteBlackerThe3rd on 2019-06-02 07:53:39 UTC
True. He also said that it gets too hot, that's why I said overuse of CPU. I had to compile kernel once, on Rpi and I had to cool down the CPU phisically, and reduce the amount of threads. I think compilation on Rpi is still not worthy with playing with swap / reducing threads too. I'd suggest cross compilation.
Asked by Orhan on 2019-06-02 20:33:19 UTC
change the configuration in the file */etc/dphys-swapfile *: Default is CONF_SWAPSIZE=100
- Do "sudo nano /etc/dphys-swapfile"
- change default to CONF_SWAPSIZE=1024
- restart swap with sudo /etc/init.d/dphys-swapfile stop 4. sudo /etc/init.d/dphys-swapfile start
- Do this to check if it worked free -m
Please read into the effect of doing swap on the sd card.. short for multiple writes to sd decreases the life but read more here https://www.bitpi.co/2015/02/11/how-to-change-raspberry-pis-swapfile-size-on-rasbian/
Asked by fyi on 2019-06-02 06:19:07 UTC
Comments
@fyi the sudo nano opens an empty document. I edited added swapsize, then for the stop command it says "/etc/init.d/dphys-swapsize: command not found". Does this command works on ubuntu mate, because in the link you gave its given for raspbian?
Asked by sajal on 2019-06-03 00:49:37 UTC
Comments