lucenenet-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "George Aroush (JIRA)" <>
Subject [jira] Commented: (LUCENENET-106) Lucene.NET (Revision: 603121) is leaking memory
Date Wed, 24 Dec 2008 01:58:44 GMT


George Aroush commented on LUCENENET-106:


I reviewed "Paches for v2.3.1.rar", and I have the following suggestion to make:

1) CachingSpanFilter.cs, and CachingWrapperFilter.cs -- remove the line: "//cache = new System.Collections.Hashtable();"
2) FieldCacheImpl.cs -- remove the line: "//private System.Collections.IDictionary readerCache
= new System.Collections.Hashtable();"
3) FieldCacheImpl.cs -- remove the method "Close(IndexReader reader)", it's no longer need
(doesn't exists in the Java ver.); it was added to the C# version in 2.0 to eliminate this
memory leak issue regarding hash-n-sort; look in the HISTORY.txt file under 27Nov06 for the
4) WeakHashTable.cs -- move this code to SupportClass.cs and then you don't have to commit
a new file -- this file -- to SVN; just add a new class, WeakHashTable in SupportClass.cs.
 The reason why I'm making this comment is to keep the port 1-to-1 with the Java version.
5) Form1.cs -- do not commit this file to SVN.

If you agree with my review and comments, please go ahead and commit with my suggested changes.


-- George

> Lucene.NET (Revision: 603121) is leaking memory
> -----------------------------------------------
>                 Key: LUCENENET-106
>                 URL:
>             Project: Lucene.Net
>          Issue Type: Bug
>         Environment: .NET 2.0
>            Reporter: Anton K.
>            Priority: Critical
>         Attachments: DIGY-FieldCacheImpl.patch, Digy.rar, luceneSrc_memUsage.patch, Paches
for v2.3.1.rar, WeakHashTable+FieldCacheImpl.rar, WeakReferences.rar
> 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.
> 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.

View raw message