* Dhaval Giani <[email protected]> [2009-05-07 13:30:44]:
> On Thu, May 07, 2009 at 01:59:34PM +0900, Ken'ichi Ohmichi wrote:
> >
> > Hi Dhaval,
> >
> > Dhaval Giani wrote:
> > > On Mon, Apr 13, 2009 at 04:38:04PM +0530, Dhaval Giani wrote:
> > >> On Wed, Apr 08, 2009 at 05:33:01PM +0900, Ken'ichi Ohmichi wrote:
> > >>> Hi,
> > >>>
> > >>> I tested a cgrlesengd daemon with huge load, which makes many 'su',
> > >>> in long time. And the daemon was killed by an OOM killer. So the
> > >>> daemon has memory leak. This patch fixes this problem.
> > >>>
> > >>> The daemon allocates memory at cg_prepare_cgroup(), but it does not
> > >>> free the memory. This patch adds necessary free() to cgroup_change_
> > >>> cgroup_path by calling cgroup_free_controllers(). In addition, this
> > >>> patch adds free()s for handling error and flushes the counters of the
> > >>> allocations in cgroup_free_controllers().
> > >>>
> > >>>
> > >>> Thanks
> > >>> Ken'ichi Ohmichi
> > >>>
> > >>> Signed-off-by: Ken'ichi Ohmichi <[email protected]>
> > >>> --
> > >>> diff -rpuN a/src/api.c b/src/api.c
> > >>> --- a/src/api.c 2009-04-01 14:59:19.000000000 +0900
> > >>> +++ b/src/api.c 2009-04-08 17:47:27.000000000 +0900
> > >>> @@ -1715,6 +1715,7 @@ unlock_error:
> > >>> * XX: Need to figure out how to cleanup? Cleanup just the stuff
> > >>> * we added, or the whole structure.
> > >>> */
> > >>> + cgroup_free_controllers(cgroup);
> > >> This is wrong. We still leave a leak in. We need a
> > >>
> > >
> > > Just to clarify, right now there is no leak, but once I do those
> > > changes, we will have unless we clean up then as well. So let us do it
> > > right now. (and I would like those changes elsewhere as well, where we
> > > do it with the idea to free the cgroup related leaks)
> >
> > What is the status of this patch ?
> > The latest code of git tree has the same leak problem still,
> > and this patch is necessary.
> >
> > This patch fixes the problems other than memory leak (adding free()s
> > for handling error and flushing the counters of allocations) also.
> > May I repost the patch only for fixing memory leak to clarify the
> > discussion ?
> >
>
> You need to call cgroup_free and not cgroup_free_controllers. I think a
> repost with that change, and it should be good to merge in.
>
Dhaval, I don't think we can expect this patch to fix a bug you might
introduce in the future. IMHO, the patch is good to go.
--
Balbir
------------------------------------------------------------------------------
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image
processing features enabled. http://p.sf.net/sfu/kodak-com
_______________________________________________
Libcg-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/libcg-devel