-
Notifications
You must be signed in to change notification settings - Fork 867
Use shared_ptr/weak_ptr for keyframe and landmark #139
Conversation
@ymd-stella At a glance, the following modifications are needed:
|
@ymd-stella |
@ymd-stella |
@ymd-stella Great job! Thank you. It seems to me that you have not fully resolved circular references issue. The landmark still has "observations" map with pointers to key_frames. It seems to me that most of keyframes will leak that way |
@stolpa4 You're right. Thanks. I'll fix it. |
openvslam/src/openvslam/data/landmark.cc Lines 277 to 292 in 6de5fec
The observations_ is cleared before the landmark is deleted, so it seems to work fine.
|
@ymd-stella As for In a similar system, I've broke this dependency by changing the vector of shared pointers to landmarks in the
This can lead to a minor performance degradation, but in my tests it is not sufficient and I consider it as a good price for the safe memory usage. |
I didn't care for the reset. |
@ymd-stella No problems. It is not a question to you, but rather it is a must-have for the project, as it can be used in such long-term application, but makes it really hard because of the memory management issue. |
Thank you for your work!
I implemented a version that uses shared_ptr/weak_ptr for keyframe and landmark.
There seems to be almost no performance degradation that was mentioned below.
(ref: #9 (comment))