keroro824 / HashingDeepLearning

Codebase for "SLIDE : In Defense of Smart Algorithms over Hardware Acceleration for Large-Scale Deep Learning Systems"
MIT License
1.07k stars 169 forks source link

Memory leaks #21

Open deni64k opened 4 years ago

deni64k commented 4 years ago

I noticed wrong usage of delete. For instance here: https://github.com/keroro824/HashingDeepLearning/blob/e5a2078c575b8786698c0eb354dd20852be1fdcf/SLIDE/Layer.cpp#L109

Such expressions destroy only their first operand, ignoring everything followed by comma. More precisely, comma is an operator that divides delete-expression into two independent parts.

keroro824 commented 4 years ago

@deni64k thanks for catching this!

Eslam2011 commented 3 years ago

thanks for catching this!

I want asked why they didn't edit the notice of @deni64k.

ZehMatt commented 3 years ago

I just stumbled upon this project and found that a lot of the code is not very C++'ish. There is also the fact that it re-allocates all the memory for every iteration with fixed size buffers. I believe a lot of code can be simplified by using std::vector instead of new/delete. I might try to refactor some of it at some point if no one beats me to it.