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
Could you please provide the source code of your node?
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.
What is the input source (into gmapping) frequency? I.e. your laser scanner, etc.