Open billyean opened 3 years ago
Did you identify a memory leak then?
Indeed it could be that this is not very efficient. If you have large batches to replace it could be faster to do a remove_ids and then add_with_ids.
For our case, we do see after a couple of days running, the application eat up all of our memory. We did implement with calling remove_ids before calling add_with_ids, but we still observe the memory raising up after a long run.
Summary
We're using IndexIVFFlatDedup::add_with_ids to replace the vector whenever there is any change, since the number of change is a lot. We randomly detect some memory leak. We check the source as follows It looks like add_with_ids will do memcpy for every entry that is adding, if to be added ids are a lot, this is going to cause problem, can we consolidate all vectors that are not duplicate before add, then call add_entries one time
Platform
OS: CentOS 7
Faiss version:
Installed from:
Faiss compilation options:
Running on:
Interface:
Reproduction instructions