[eigen] tracking memory usage?

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


Hi all,

I've written a program using eigen2, without paying too much attention
either to time or space efficiency.  I'm now confident that the
program is correct (so far... but it's not complete), and am looking
to refactor it to reduce memory consumption.

Ordinarily in C++ I would figure out where the memory is going by
instrumenting the constructors and destructors of large data types to
track net memory use and log it (and log who allocated it).  I can do
the same thing with some of my code in this case (since I derive a
subclass of VectorXd), but that won't count any actual VectorXds that
get allocated directly.

My primary approach I expect to be switching functions that currently
accept (const VectorXd &) to accept instead somthing like (const
Eigen::MatrixBase <OtherDerived>&) to enable lazy evaluation of
expressions.  My understanding is that creating functions that
*return* a lazily evaluated vector is tricky...

Any suggestions or hints, of approaches that work effectively in
improving memory use in eigen2 programs? (Or if it'd be worth
switching to eigen3?)

Thanks for the great package!
-- 
David Roundy



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