Open MPI logo

Open MPI Development Mailing List Archives

  |   Home   |   Support   |   FAQ   |   all Development mailing list

Subject: Re: [OMPI devel] RFC : what is the best way to fix the memory leak in mca/pml/bfo
From: Ralph Castain (rhc_at_[hidden])
Date: 2014-05-16 08:54:05


Memory isn't supposed to allocated in the "open" call, but only after the component is selected (and thus in the "init" call").

On May 15, 2014, at 10:57 PM, Gilles Gouaillardet <gilles.gouaillardet_at_[hidden]> wrote:

> Folks,
>
> there is a small memory leak in ompi/mca/pml/bfo/pml_bfo_component.c
>
> in my environment, this module is not used.
> this means mca_pml_bfo_component_open() and mca_pml_bfo_component_close() are invoked but
> mca_pml_bfo_component_init() and mca_pml_bfo_component_fini() are *not* invoked.
>
> mca_pml_bfo.allocator is currently allocated in mca_pml_bfo_component_open() and released in mca_pml_bfo_component_fini()
> this causes a leak (at least in my environment, since mca_pml_bfo_component_fini() is not invoked)
>
> One option is to release the allocator in mca_pml_bfo_component_close()
> An other option is to allocate the allocator in mca_pml_bfo_component_init()
>
> Which is the correct/best one ?
>
> i attached two patches, which one (if any) should be commited ?
>
> Thanks in advance for your insights
>
> Gilles
> <bfo.allocate_in_init.patch><bfo.free_in_close.patch>_______________________________________________
> devel mailing list
> devel_at_[hidden]
> Subscription: http://www.open-mpi.org/mailman/listinfo.cgi/devel
> Link to this post: http://www.open-mpi.org/community/lists/devel/2014/05/14815.php