Re: deleting a map does not release the corresponding memory from RAM.

Posted by Amber on
URL: http://official-rtab-map-forum.206.s1.nabble.com/deleting-a-map-does-not-release-the-corresponding-memory-from-RAM-tp9102p9110.html

Hi Matheu,

The issue mentioned in the above message is still there. I would like to further explain it. I play with the OnInit() function. I created a service (that passes the new map path) that once called, will delete the old map by calling _rtabmap.close(). Then, it would call _rtabmap.init() so that the new map can be loaded. The problem is that although the old map data do not persist in the program, but it is not released from the RAM. I looked into it in detail. I find that _dbDriver->loadSignatures(...)is causing a part of it. I tried to delete the Signature pointers first from the dbSignatures and then remove it, but the memory is still not freed. I tried to replace std::list<Signature*> with std::vector<Signature*>. But still no success. The memory is released only when rtabmap node is crashed. Even calling ~Rtabmap() and ~Memory() do not help it seems. That means, even if I don't call _rtabmap.Init() again and just call _rtabmap.close(), that does not release the memory occupied by the previous map. This is very surprising to me. May I request your observation on this?

thanks,