ABY icon indicating copy to clipboard operation
ABY copied to clipboard

Memory Management

Open fionser opened this issue 6 years ago • 3 comments

Hi, I am new to ABY, but I found many "new" in ABY, such as in share = PUTXXGate(share). So I am curious that does the ABY do the memory management for us ? Or we should pay attention about the memory leakage ?

fionser avatar Dec 21 '17 04:12 fionser

I have been wondering the same. Looking at the code of some of the PutXXGate implementations returning shares, which just allocate a boolshare or arithshare, fill its wires and return it, it seems to me that ABY does not keep track of the created share object, meaning that we would have to take care of that ourselves..

It would be nice if that could be confirmed or denied by someone officially engaged with the project though :)

lumip avatar Dec 13 '18 12:12 lumip

ABY is currently not properly deallocating shares.

This was also mentioned in #15 where also a possible mitigation is presented.

dd23 avatar Dec 13 '18 13:12 dd23

Hi, yes, this is known a problem, see e.g. #15. Unfortunately, this has not been resolved yet.

Some users have written custom wrappers using reference-counted shared_pointers. See e.g. here or here.

lenerd avatar Dec 13 '18 13:12 lenerd