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

Memory leak in gate bootstrapping API #255

Open
j2kun opened this issue Feb 1, 2023 · 0 comments
Open

Memory leak in gate bootstrapping API #255

j2kun opened this issue Feb 1, 2023 · 0 comments

Comments

@j2kun
Copy link

j2kun commented Feb 1, 2023

The gate bootstrapping API appears to have a memory leak. I've observed this when running long programs, that for each call to bootsAND (or any other function), a new instance of FFT_Processor_Spqlios is created, which in turn allocates new fft/ifft lookup tables, and they are never freed (see the commented-out delete calls in https://github.com/tfhe/tfhe/blob/master/src/libtfhe/fft_processors/spqlios/fft_processor_spqlios.cpp#L118-L119) and the comment in

//TODO attention, improve these new/delete...
that mentions the new/delete need to be improved.

As I understand it, no more development work will go into this repository, so this issue is more of a note to any other users that this code contains a memory leak, and that the fftw backend should probably be used instead. I may try to patch the memory leak myself, but given that there have been no feature/bug fix commits on this repository for almost two years, I will probably not try to get a fix upstreamed.

That said, allocating these lookup tables once instead of on every single gate bootstrapping call would probably improve the performance of the Spqlios part of this library.

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