Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sparse map: report memory usage #721

Open
wants to merge 7 commits into
base: develop
Choose a base branch
from
Open

Conversation

trey0
Copy link
Contributor

@trey0 trey0 commented Apr 10, 2023

Added methods to report approximate memory usage of the sparse map data structures. This is not the same as the sparse map file size on disk because the in-memory representation is different from the file serialization, and memory usage also varies depending on the architecture we're running on.

This PR relies on bag of words memory usage reporting methods in #702. It's not expected to pass tests until #702 is merged to master and deployed to astrobee_base.

The larger aim is to figure out the main contributors to sparse map memory usage so we can evaluate possible optimizations.

Here is example output for the hamilton map running on x86_64, will be different on armhf:

SparseMap::ReportMemoryUsage:
          1752 num_cid
        114504 num_pid
        349729 num_features

           736 sparse_map_bytes
        147652 cid_to_filename_bytes
             0 cid_to_keypoint_map_bytes
             0 pid_to_cid_fid_bytes
       2748096 pid_to_xyz_bytes
             0 cid_to_cam_t_global_bytes
      22550848 cid_to_descriptor_map_bytes
      12674340 cid_fid_to_pid_bytes

  DBoW database:
       1240609   num_rows
       1453996   num_ifpairs

      76302488   m_ifile_bytes
             0   m_dfile_bytes

  DBoW vocabulary:
       1511709   num_nodes
       1240609   num_words

     114889880   m_nodes_bytes
       9924872   m_words_bytes

     201117240 vocab_db_bytes
             0 db_to_cid_map_bytes
     239238912 total_bytes

             0 num_cid_to_cid
             0 num_user_cid
             0 num_user_pid

  num_entries_per_descriptor: 64
  descriptor_entry_bytes: 1

This was originally opened as #703, but the GitHub PR diffs got stale somehow, so here it is as a new PR.

@trey0 trey0 requested a review from bcoltin April 10, 2023 20:57
@marinagmoreira
Copy link
Member

last checked this PR on 7/19/2023 and #702 hasn't been tested in space yet, so waiting to merge

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants