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

Error with octomap_server: "process has died, exit code -6" [closed]

asked 2014-10-08 19:29:01 -0600

ajain gravatar image

I am trying to use octomap_server (octomap_mapping.launch file) for building a 3D map using point cloud data from velodyne. So i drive my robot around, record all sensor data for octomap_server to post process it on my desktop. I really want to play the rosag at slower rate so that I can get a better 3D map, but unfortunately the slower I run the rosbag more I get the following error (process has died, exit code -6):

terminate called after throwing an instance of 'std::bad_alloc'
  what():  std::bad_alloc

Once this error occurs, I have to restart octomap_server and then I loose the previously saved 3D map. If I play my rosbag at more than 2x speed, then octomap_server doesn't fail but I don't get a good 3D map. Does someone have anything on why am I getting this error?

Also, sometimes the following error pops up, I don't know what that means but it doesn't seem to effect octomap processing. Can someone throw some light on this too.

[ERROR] [1412812984.342799452]: Error serializing OctoMap
edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by ajain
close date 2014-10-09 12:53:54.680613


std::bad_alloc means that your process failed to allocate memory. How much memory is the octomap server using before it crashes?

ahendrix gravatar image ahendrix  ( 2014-10-08 21:51:54 -0600 )edit

I have a 4 core processor with 16GB RAM. Observing top for few runs, I observed that octomap_server process uses almost 100% of one core, and the memory usage grows up to 18.4% every time before it dies. Is there any way to allocate more space to the process, as I still have 60% of memory free.

ajain gravatar image ajain  ( 2014-10-09 10:51:05 -0600 )edit

That's awfully close to 3GB. Are you running a 32-bit version of Ubuntu or a 32-bit version of octomap?

ahendrix gravatar image ahendrix  ( 2014-10-09 11:51:10 -0600 )edit

Most of the memory consumed by octomap_server is actually for the different kinds of visualizations, not for the octomap itself. You can reduce the memory usage by not subscribing to the PointCloud and voxel visualizations (they thus won't be created).

AHornung gravatar image AHornung  ( 2014-10-10 12:07:17 -0600 )edit

Instead, use the octomap_rviz_plugins package. It will directly create a visualization in RViz out of the serialized octomap.

AHornung gravatar image AHornung  ( 2014-10-10 12:08:07 -0600 )edit

@AHornung: I am using MarkerArray display in RViz on the topic "occupied_cells_vis_array", and changing it to display OccupancyGrid type message from octomap_rviz_plugin doesn't change anything. It still crashes.

ajain gravatar image ajain  ( 2014-10-10 12:53:09 -0600 )edit

I migrated to a 64-bit platform now. Everything works fine. Apparently, octomap_server is using up to ~5GB RAM which makes sure that I should not run octomap server in real time on a robot.

ajain gravatar image ajain  ( 2014-10-13 17:21:15 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2014-10-09 12:22:54 -0600

ajain gravatar image

updated 2014-10-17 01:14:52 -0600

Thanks ahendrix for leading me in the right direction. After you pointed out the problem with memory allocation, I read a little bit more about how memory allocation works with processes. I am running a 32-bit OS which limits to 2.75 - 3 GB address allocation memory, which is close to 18.4% of 16GB (= 2.94GB). So I'm definitely hitting memory limit. (Reference:

Having the rosbag run at different speeds, and still failing at 18.4% memory usage every time makes sure that the above error is because I'm using a 32-bit machine.

I'll try running it on a 64-bit computer, and post the limitations (if any) of using octomap with 64 bit.

Edit: Now that I'm on a 64-bit machine (with 32GB RAM), I tried mappusing octomap. The system monitoring stats show that octomap at its peak uses up toing an outdoor area of around 100mx20m (post processing on recorded data) 50% of memory (range- 35-50%) along multiple processes running on multiple processors (using at least 1 complete core). Now I am convinced that a 64-bit machine with 16+GB RAM is a minimum requirement for building octomap for large areas.

edit flag offensive delete link more


You're probably actually hitting the 3GB/1GB user/kernel split described here: , but the end result is the same: you need a 64-bit OS.

ahendrix gravatar image ahendrix  ( 2014-10-09 12:37:11 -0600 )edit

Question Tools

1 follower


Asked: 2014-10-08 19:29:01 -0600

Seen: 3,888 times

Last updated: Oct 17 '14