From: Anthony N. <ant...@gm...> - 2013-08-09 22:56:18
|
Hi Borek, Thank you very much for creating the memleak_fixes branch! We have actually seen some other memory leaks during testing. Firstly when DirectoryIndexReader::startCommit is called consecutively, rollbackSegmentInfos is not freed if it was previously allocated. The below patch fixes the leak and could be incorporated into your branch if not already addressed (somebody with better knowledge of the library may also want to review): --- a/clucene-core-2.3.3.4/src/core/CLucene/index/DirectoryIndexReader.cpp +++ b/clucene-core-2.3.3.4/src/core/CLucene/index/DirectoryIndexReader.cpp @@ -274,6 +274,9 @@ CL_NS_DEF(index) */ void DirectoryIndexReader::startCommit() { if (segmentInfos != NULL) { + if (rollbackSegmentInfos != NULL) { + _CLDELETE(rollbackSegmentInfos); + } rollbackSegmentInfos = segmentInfos->clone(); } rollbackHasChanges = hasChanges; Secondly, we are seeing many leaks of lucene::index::MergePolicy::OneMerge and lucene::index::SegmentInfos. Unfortunately, I do not yet have a patch as I haven't been able to investigate but will do so in the coming weeks. I am eager to see your branch merged into master to use that as the basis for further memory leak investigation. Thanks again! Best regards, Anthony |