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

------------------------------------------------------------------------------
Get 100% visibility into Java/.NET code with AppDynamics Lite!
It's a free troubleshooting tool designed for production.
Get down to code-level detail for bottlenecks, with <2% overhead. 
Download for free and get started troubleshooting in minutes. 
http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk
_______________________________________________
CLucene-developers mailing list
CLucene-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/clucene-developers

Reply via email to