code review
Filip Drabek
fdrabek at redhat.com
Wed Jul 27 15:50:42 UTC 2011
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://fedorahosted.org/pipermail/rhq-devel/attachments/20110727/e447b2c4/attachment.html
More information about the rhq-devel
mailing list