Registered Member
|
Hi guys,
I am trying to eliminate memory allocation hotspots in my software. By overloading malloc and friends I am able to collect some statistics on which backtrace is responsible for most memory allocations. When looking at the sheer number of calls Eigen comes out on top with several locations allocating 0 bytes - millions and millions of times. Depending on the malloc implementation this may not matter but it may also cause some overhead. In particular there are two functions that make up most of the zero sized allocations: Eigen::Matrix<float, -1, 1, 0, -1, 1>::Matrix(Eigen::Matrix<float, -1, 1, 0, -1, 1> const&) Eigen::Matrix<float, -1, 1, 0, -1, 1>::Matrix<Eigen::Block<Eigen::Matrix<float, -1, 1, 0, -1, 1> const, -1, -1, false> >(Eigen::MatrixBase<Eigen::Block<Eigen::Matrix<float, -1, 1, 0, -1, 1> const, -1, -1, false> > const&) Shouldn't these be optimized away? Am I doing something wrong? I tried compiling with EIGEN_NO_MALLOC but to no avail. Any ideas? thanks, nils |
Moderator
|
I cannot reproduce, even if I explicitly create and copy empty vectors. Could you paste a typical callstack triggering an empty malloc?
|
Registered users: bartoloni, Bing [Bot], Evergrowing, Google [Bot], ourcraft