Subscribing /map consumes 4gb of memory!?!?!
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?
[EDIT]:
import rospy
from nav_msgs.msg import OccupancyGrid
def callback(data):
return None
if __name__ == '__main__':
rospy.init_node('test_node')
rospy.Subscriber("/map", OccupancyGrid, callback)
rospy.spin()
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.
Thanks
Asked by NunoFialho on 2016-05-06 11:32:32 UTC
Comments
Could you please provide the source code of your node?
Asked by Mani on 2016-05-06 19:04:28 UTC
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.
Asked by janindu on 2016-05-09 00:49:34 UTC
What is the input source (into gmapping) frequency? I.e. your laser scanner, etc.
Asked by l0g1x on 2016-05-09 11:48:33 UTC