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

Reloading the index causes a memory leak #1460

Open
arikh1907 opened this issue Mar 8, 2023 · 0 comments
Open

Reloading the index causes a memory leak #1460

arikh1907 opened this issue Mar 8, 2023 · 0 comments

Comments

@arikh1907
Copy link

Using FaissSearcher I am trying to reload the index after updating the directory. The Searcher is updated with the new data, however the memory of the previous load is not released. After several iterations the process memory is exhausted. Is there a way to avoid this while updating the index?

The code is:

    if is_first_load:
        self._dense_searcher = FaissSearcher(self._dense_index_dir, self._encoder)
   else:
        self._dense_searcher.index, self._dense_searcher.docids = self._dense_searcher.load_index(self._dense_index_dir)
        self._dense_searcher.dimension = self._dense_searcher.index.d
        self._dense_searcher.num_docs = self._dense_searcher.index.ntotal
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

No branches or pull requests

1 participant