[ 
https://issues.apache.org/jira/browse/LUCENENET-106?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12554833
 ] 

Ross Faneuf commented on LUCENENET-106:
---------------------------------------

I also ran into this bug. The translation of the Java WeakHashMap to .Net 
results in one of the few ways I've encountered to completely defeat the CRL 
garbage collector. My solution was to replace the use of the thread data cache 
with an instance variable, since the effect of the .Net code was to re-cache 
the information for every instance.

Our code closes a cached IndexSearcher and reacquires a new instance whenever 
the index version changes. This bug resulted in a steady memory leak which 
could bring down a service process after running for a relatively few days.

> Lucene.NET (Revision: 603121) is leaking memory
> -----------------------------------------------
>
>                 Key: LUCENENET-106
>                 URL: https://issues.apache.org/jira/browse/LUCENENET-106
>             Project: Lucene.Net
>          Issue Type: Bug
>         Environment: .NET 2.0
>            Reporter: Anton K.
>            Priority: Critical
>
> readerCache Hashtable field (see FieldCacheImpl.cs) never releases some hash 
> items that have closed IndexReader object as a key. So a lot of Term 
> instances are never released.
> Java version of Lucene uses WeakHashMap and therefore doesn't have this 
> problem.
> This bug can be reproduced only when Sort functionality used during search. 
> See following link for additional information.
> http://www.gossamer-threads.com/lists/lucene/java-user/55681
> Steps to reproduce:
> 1)Create index
> 2) Modify index by IndexWiter; Close IndexWriter
> 3) Use IndexSearcher for searching with Sort; Close InexSearcher
> 4) Go to step 2
> You'll get OutOfMemoryException after some time of running this algorithm.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to