[eigen] Re: memory leak in fftw wrapper maybe

[ Thread Index | Date Index | More lists.tuxfamily.org/eigen Archives ]


Upon a little more inspection, I think the problem is on the fftw side of things. The reachable memory does not grow with calls to inv, or construction of Eigen::FFT objects.

Sorry for the noise.

-- Trevor



On 8 September 2010 17:56, Trevor Irons <trevorirons@xxxxxxxxx> wrote:
I have a question about the fftw wrapper. When I compile the following code

#include <Eigen/Core>
#include <unsupported/Eigen/FFT>

int main() {
    Eigen::FFT<double> fft;
    Eigen::VectorXcd      Y;
    Eigen::VectorXcd     X;
    X.resize(100);
    fft.inv(Y, X);
}

With   g++ fft.cpp  -I/home/tirons/src/eigen -DEIGEN_FFTW_DEFAULT -lfftw3

and run this through valgrind
valgrind --leak-check=full  ./a.out

I see

==5362== 22,688 bytes in 1 blocks are still reachable in loss record 68 of 68
==5362==    at 0x4C25FAD: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==5362==    by 0x4E3E844: fftw_malloc_plain (in /usr/lib/libfftw3.so.3.2.4)
==5362==    by 0x4E41225: register_solver (in /usr/lib/libfftw3.so.3.2.4)
==5362==    by 0x4E8864B: fftw_regsolver_hc2c_direct (in /usr/lib/libfftw3.so.3.2.4)
==5362==    by 0x4E42577: fftw_solvtab_exec (in /usr/lib/libfftw3..so.3.2.4)
==5362==    by 0x4E7DEF0: fftw_rdft_conf_standard (in /usr/lib/libfftw3.so.3.2.4)
==5362==    by 0x4F0AD20: fftw_configure_planner (in /usr/lib/libfftw3.so.3.2.4)
==5362==    by 0x4F0F49B: fftw_the_planner (in /usr/lib/libfftw3.so.3.2.4)
==5362==    by 0x4F0AB2C: fftw_mkapiplan (in /usr/lib/libfftw3.so.3.2.4)
==5362==    by 0x4F0F0C1: fftw_plan_many_dft (in /usr/lib/libfftw3.so.3.2.4)
==5362==    by 0x4F0E598: fftw_plan_dft (in /usr/lib/libfftw3.so.3.2.4)
==5362==    by 0x4F0E345: fftw_plan_dft_1d (in /usr/lib/libfftw3.so.3.2.4)
==5362==
==5362== LEAK SUMMARY:
==5362==    definitely lost: 0 bytes in 0 blocks
==5362==    indirectly lost: 0 bytes in 0 blocks
==5362==      possibly lost: 0 bytes in 0 blocks
==5362==    still reachable: 52,768 bytes in 617 blocks
==5362==         suppressed: 0 bytes in 0 blocks


When I don't use the fftw wrapper this does not happen, but fftw is much faster and I'm using it a lot.  Is this something to be concerned about? Is the plan just not being destroyed? Thanks for any advice.

-- Trevor



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/