lucenenet-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "udanax (JIRA)" <j...@apache.org>
Subject [jira] Created: (LUCENENET-29) some bug in .net 1.*
Date Wed, 15 Nov 2006 05:19:37 GMT
some bug in .net 1.*
--------------------

                 Key: LUCENENET-29
                 URL: http://issues.apache.org/jira/browse/LUCENENET-29
             Project: Lucene.Net
          Issue Type: Bug
         Environment: windows 2003
            Reporter: udanax
            Priority: Critical


some bug in .net 1.*
if use sort() then we meet memory leak error.

must be readerCache.Clear(); in Store() method.

open Search\FieldSortedHitQueue.cs 
and add method.

internal static void Close(IndexReader reader) 
{ 
lock (Comparators.SyncRoot) 
{ 
System.Collections.Hashtable readerCache = (System.Collections.Hashtable) Comparators[reader];

if (readerCache != null) 
{ 
readerCache.Clear(); 
} 

Comparators.Remove(reader);
} 
} 


and... FieldCacheImpl.cs add method,too

public virtual void Close(IndexReader reader)
{ 
lock (this) 
{ 
System.Collections.Hashtable readerCache = (System.Collections.Hashtable) cache[reader]; 
if (readerCache != null) 
{ 
readerCache.Clear(); 
readerCache = null;
}

cache.Remove(reader); 
} 
} 


and then, edit Close() method of IndexSearcher class 

public override void Close()
{
FieldSortedHitQueue.Close(reader); 
Lucene.Net.Search.FieldCache_Fields.DEFAULT.Close(reader);

if (closeReader)
reader.Close();
}


And there is an omission in the article that I made.
Additionaly the FieldCacheImpl Class was inherited an 'FieldCache interface (FirldCache.cs)'

and you should define its 'close() method' as a 'void Close (IndexReader reader);'


i wanna become lucene.net committer.
how can i do?

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message