Subscribing /map consumes 4gb of memory!?!?!

asked 2016-05-06 11:32:32 -0500

NunoFialho gravatar image

updated 2016-05-09 09:58:04 -0500

I have created a python node that just subscribes /map from gmapping. Callback function does nothing, only returns null. By starting this node I can see an increase of around 4gb in my ram. I know each /map message have around 100mb.

Can anyone tell me if this is normal behaviour?


import rospy
from nav_msgs.msg import OccupancyGrid

def callback(data):
    return None

if __name__ == '__main__':
    rospy.Subscriber("/map", OccupancyGrid, callback)

I also have realized that running rostopic echo /map will consume even more memory ending up crashing the system...

[EDIT 2]:

I’ve tried to decrease map resolution from 0.01 to 0.025 and now it works fine.


edit retag flag offensive close merge delete


Could you please provide the source code of your node?

Mani gravatar image Mani  ( 2016-05-06 19:04:28 -0500 )edit

Please provide the code. There can be many reasons for this. A very straight forward one would be you storing each map message in your memory, growing it very fast.

janindu gravatar image janindu  ( 2016-05-09 00:49:34 -0500 )edit

What is the input source (into gmapping) frequency? I.e. your laser scanner, etc.

l0g1x gravatar image l0g1x  ( 2016-05-09 11:48:33 -0500 )edit