From: John P. <jwp...@gm...> - 2008-08-11 20:50:32
|
Hi, I think I may have found the leak... Check out clear_dofs() in dof_object.h After deleting _n_v_comp[s], we test to see if there are any dof_ids to be deleted: if (this->n_vars(s) != 0) // This has only been allocated if { // variables were declared libmesh_assert (_dof_ids[s] != NULL); delete [] _dof_ids[s]; _dof_ids[s] = NULL; } However, this->n_vars(s) always returns zero, because we just deleted _n_v_comp[s]. Therefore, _dof_ids[s] is leaked for each system, at every destructor call. I recommend reversing the order of these delete steps, and we should be good. I'll test this now and see if it fixes the leak. In a more general sense, are we still worried enough about the overhead of std::vector to warrant all this dynamic memory allocation business? I'd like to see some profiling that shows the additional overhead of std::vector, but on the other hand, I'd rather not rewrite DofObject first :) -- John |