rtabmap icon indicating copy to clipboard operation
rtabmap copied to clipboard

probably wrong code is activated in localization mode causing to memory leak

Open alexkunin-gh opened this issue 11 months ago • 1 comments

rtabmap.cpp line 1754 the following code supposed to be activated in the mapping only but actually running also in localization mode and causing to memory leak over time:

_constraints.insert(std::make_pair(tmp.from(), tmp));

can you explain what is the purpose of _constraints ? we tried to fix it to
if(signature->getLinks().size() && signature->getLinks().begin()->second.type() == Link::kNeighbor && _memory->isIncremental())

but got some errors that some nodes not found in the graph.. thanks

alexkunin-gh avatar Jan 27 '25 08:01 alexkunin-gh

You are referring to this line: https://github.com/introlab/rtabmap/blob/ddaf2f52715d975ecd9da8ab197f17571f731d00/corelib/src/Rtabmap.cpp#L1754

There is an answer here about the same question: http://official-rtab-map-forum.206.s1.nabble.com/memory-increase-when-robot-is-static-tp10863p10874.html

Can you add

UASSERT(_memory->isIncremental())

under this if statement: https://github.com/introlab/rtabmap/blob/ddaf2f52715d975ecd9da8ab197f17571f731d00/corelib/src/Rtabmap.cpp#L1725-L1728

then launch rtabmap with --udebug argument to show all debug logs. Run till it asserts there and post the whole debug log here.

matlabbe avatar Feb 03 '25 01:02 matlabbe