DIGY's patch to provide a functional equivalent of Java's WeakHashTable is currently in the trunk, and is in all versions after the 2.3.1 tag in SVN.
I suggest upgrading to a version greater than 2.3.1 and verifying your memory usage. It doesn't remove items from the cache when the searcher is closed, however when a new item is added to the cache the WeakReferences are tested to see if an item is no longer in use and can be removed from cache. Michael -----Original Message----- From: Digy [mailto:[email protected]] Sent: Tuesday, February 02, 2010 8:14 AM To: [email protected] Subject: RE: Attempt fix of memory leak at FieldCacheImpl of Lucene.Net 2.1.0 Have you read http://issues.apache.org/jira/browse/LUCENENET-106 ? DIGY From: Billy Ho [mailto:[email protected]] Sent: Tuesday, February 02, 2010 5:17 PM To: [email protected] Subject: Attempt fix of memory leak at FieldCacheImpl of Lucene.Net 2.1.0 Hi, We have observed the lucene.net 2.1.0 library keep leaking memory in our application. One of the places we have found is located in FieldCacheImp.cs The size of the readerCache IDictionary instance in the Cache class keep glowing. The keys and the values of the dictionary are the IndexReader instances and the string[] of a specific column of all documents in the index respectively. The attempt fix is to remove an entry from the readerCache dictionary at the Close method of the IndexSearcher. Would like to know if the change attempt fix make sense. Thanks a lot. Best Regards, Billy
