code review

Lukas Krejci lkrejci at redhat.com
Thu Jul 28 10:15:42 UTC 2011


I created a review for this on review board and added my comments.

https://fedorahosted.org/reviewboard/r/179/

On Wednesday, July 27, 2011 17:50:42 Filip Drabek wrote:
> Hi,
> as you know there is a problem with memory leak in augeas based plugins.
> (https://bugzilla.redhat.com/show_bug.cgi?id=721152)
> I would like to ask you for code review of my changes in augeas based
> plugins. The code is in branch release-3.0.0
> commit 4cfd2eb0b6f12bb9e4cd77862a0aa0e2292580e2 and
> b787f3937f7618bfc83aad8bbc4e4ed67eb97b3e
> The problem was that after initialization of augeas we were calling
> augeas.load() to load the configuration files, but
> we were not calling method augeas.close() to release the memory in heap.
> 
> The solution is:
>   - added method finalize where we can close the augeas.
>   - once augeas is initialized and the method load() is called multiple
> times the memory usage is still growing.
>     So we can not reuse the augeas instance and we need to call method
> close() after each augeas use (started by method load())
> 
> I have tried more solutions like new augeas components or implementing
> inner classes for each use of augeas, but in the end
> the code was always much worse than in this implemented solution.
> 
> Thanks
> Filip


More information about the rhq-devel mailing list