hyye / lio-mapping

Implementation of Tightly Coupled 3D Lidar Inertial Odometry and Mapping (LIO-mapping)
https://sites.google.com/view/lio-mapping
GNU General Public License v3.0
898 stars 320 forks source link

Memory growth... #38

Closed shishiteng closed 4 years ago

shishiteng commented 4 years ago

I've tested lio_estimator_node with my own datasets and found that the memory grew over time. It grew from 9.2M to 2G in about 40 minutes. I think lio_estimator_node is just a lidar-imu odometry and it doesn't need to consume so much memory.

hyye commented 4 years ago

I will investigate this. It might be related to the inherited mapping module.

shishiteng commented 4 years ago

I will investigate this. It might be related to the inherited mapping module.

Thanks for your reply, I tried to debug this problem and found that the memory stopped growing when I commented on the function UpdateMapDatabase in Estimator.cc.

        if (!opt_point_coeff_mask_.first())
        {
          // UpdateMapDatabase(opt_corner_stack_.first(),
          //                   opt_surf_stack_.first(),
          //                   opt_valid_idx_.first(),
          //                   opt_transforms_.first(),
          //                   opt_cube_centers_.first());

          DLOG(INFO) << "all_laser_transforms_: " << all_laser_transforms_[estimator_config_.window_size - estimator_config_.opt_window_size].second.transform;
          DLOG(INFO) << "opt_transforms_: " << opt_transforms_.first();
        }

But I don't know weather the problem has been solved,I am wondering what is the role of map database in estimator node? In my opnion, there is no need to maintain a map database here. I'm very confused and looking forward to your reply.

shishiteng commented 4 years ago

I will investigate this. It might be related to the inherited mapping module.

Thanks for your reply, I tried to debug this problem and found that the memory stopped growing when I commented on the function UpdateMapDatabase in Estimator.cc.

        if (!opt_point_coeff_mask_.first())
        {
          // UpdateMapDatabase(opt_corner_stack_.first(),
          //                   opt_surf_stack_.first(),
          //                   opt_valid_idx_.first(),
          //                   opt_transforms_.first(),
          //                   opt_cube_centers_.first());

          DLOG(INFO) << "all_laser_transforms_: " << all_laser_transforms_[estimator_config_.window_size - estimator_config_.opt_window_size].second.transform;
          DLOG(INFO) << "opt_transforms_: " << opt_transforms_.first();
        }

But I don't know weather the problem has been solved,I am wondering what is the role of map database in estimator node? In my opnion, there is no need to maintain a map database here. I'm very confused and looking forward to your reply.

And as memory grows processing time of UpdateMapDatabase becomes longer and longer, this may cause a runtime system delay.

hyye commented 4 years ago

The mapping module is for the initialization only. It can be stopped after the initialization.

shishiteng commented 4 years ago

The mapping module is for the initialization only. It can be stopped after the initialization.

Got it! Thank you.

hyye commented 4 years ago

In a new branch "maplab", not merged and comprehensively tested yet, this should be fixed.