aksnzhy / xlearn

High performance, easy-to-use, and scalable machine learning (ML) package, including linear model (LR), factorization machines (FM), and field-aware factorization machines (FFM) for Python and CLI interface.
https://xlearn-doc.readthedocs.io/en/latest/index.html
Apache License 2.0
3.08k stars 518 forks source link

Memory Leak in DMatrix #359

Open bduclaux opened 3 years ago

bduclaux commented 3 years ago

Hello,

There is a memory leak in the C++ Implementation of DMatrix. The C++ destructor of DMatrix should delete every element of the SparseRow vector: std::vector<SparseRow*> row;

A call to this->Reset() in the DMatrix destructor should suffice to fix the leak. See data_structure.h line 147.

Best