lucenenet-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Digy (JIRA)" <j...@apache.org>
Subject [jira] Commented: (LUCENENET-106) Lucene.NET (Revision: 603121) is leaking memory
Date Fri, 27 Jun 2008 13:28:45 GMT

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

Digy commented on LUCENENET-106:
--------------------------------


01) MemUsage: 36460 KB
02) MemUsage: 36768 KB
03) MemUsage: 36840 KB
04) MemUsage: 36736 KB
05) MemUsage: 36740 KB
06) MemUsage: 36740 KB
07) MemUsage: 36744 KB
08) MemUsage: 36744 KB
09) MemUsage: 36744 KB
10) MemUsage: 36744 KB

There is no memory leakage in Lucene.Net 2.0.
But there is a change in logic bettween 2.0 and 2.1. For ex, there is no class "internal abstract
class Cache" in 2.0 , instead it uses a HashTable named "cache".  Also AnonymousClassCache1
... AnonymousClassCache7 do no exist in Lucene.Net 2.0
or
{code}
//2.1
        public virtual void Close(IndexReader reader)
        {
        }
{code}

{code}
//2.0
        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); 
		} 
	}

{code}

So, lot of changes are done  with 2.1

DIGY


> 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
>         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.
> 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.


Mime
View raw message