You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@lucenenet.apache.org by Billy Ho <Bi...@jobsdb.com> on 2010/02/02 16:16:44 UTC

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

                                                


RE: Attempt fix of memory leak at FieldCacheImpl of Lucene.Net 2.1.0

Posted by Digy <di...@gmail.com>.
> 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.
It was a good collaborative work of many people. But the Oscar goes to Eyal Post for the final version of WeakHashTable.
DIGY

-----Original Message-----
From: Michael Garski [mailto:mgarski@myspace-inc.com] 
Sent: Tuesday, February 02, 2010 6:55 PM
To: lucene-net-user@lucene.apache.org
Subject: RE: Attempt fix of memory leak at FieldCacheImpl of Lucene.Net 2.1.0

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:digydigy@gmail.com] 
Sent: Tuesday, February 02, 2010 8:14 AM
To: lucene-net-user@lucene.apache.org
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:BillyHo@jobsdb.com] 
Sent: Tuesday, February 02, 2010 5:17 PM
To: lucene-net-user@lucene.apache.org
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

                                                



RE: Attempt fix of memory leak at FieldCacheImpl of Lucene.Net 2.1.0

Posted by Michael Garski <mg...@myspace-inc.com>.
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:digydigy@gmail.com] 
Sent: Tuesday, February 02, 2010 8:14 AM
To: lucene-net-user@lucene.apache.org
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:BillyHo@jobsdb.com] 
Sent: Tuesday, February 02, 2010 5:17 PM
To: lucene-net-user@lucene.apache.org
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

                                                


RE: Attempt fix of memory leak at FieldCacheImpl of Lucene.Net 2.1.0

Posted by Digy <di...@gmail.com>.
Have you read http://issues.apache.org/jira/browse/LUCENENET-106 ?

 

DIGY

 

From: Billy Ho [mailto:BillyHo@jobsdb.com] 
Sent: Tuesday, February 02, 2010 5:17 PM
To: lucene-net-user@lucene.apache.org
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