ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Error "virtual space exhausted" after cloning the hector_slam package.

asked 2019-05-30 00:13:56 -0500

sajal gravatar image

updated 2019-05-30 07:54:37 -0500

Orhan gravatar image

Hi everyone,

I'm getting catkin_make error virtual space exhausted after cloning the hector_slam 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.

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2019-06-02 06:19:07 -0500

fyi gravatar image

updated 2019-06-02 06:21:05 -0500

change the configuration in the file */etc/dphys-swapfile *: Default is CONF_SWAPSIZE=100

  1. Do "sudo nano /etc/dphys-swapfile"
  2. change default to CONF_SWAPSIZE=1024
  3. restart swap with sudo /etc/init.d/dphys-swapfile stop 4. sudo /etc/init.d/dphys-swapfile start
  4. 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

edit flag offensive delete link more


@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?

sajal gravatar image sajal  ( 2019-06-03 00:49:37 -0500 )edit

answered 2019-05-30 07:58:28 -0500

Orhan gravatar image

updated 2019-06-02 20:59:42 -0500

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:

edit flag offensive delete link more


@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?

sajal gravatar image sajal  ( 2019-05-31 12:11:33 -0500 )edit

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.

PeteBlackerThe3rd gravatar image PeteBlackerThe3rd  ( 2019-06-02 07:53:39 -0500 )edit

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.

Orhan gravatar image Orhan  ( 2019-06-02 20:33:19 -0500 )edit

Question Tools

1 follower


Asked: 2019-05-30 00:13:56 -0500

Seen: 237 times

Last updated: Jun 02 '19