You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@lucenenet.apache.org by Min Yin <yi...@AI.SRI.COM> on 2008/08/19 20:41:38 UTC

System.Intern(), memory leak, and sorting

Hi there,

In our attempt to fix the memory leaking (we are using v2.1.0), we 
replace all the System.Intern(s) with s itself in the source code. The 
theory being System.Intern(s) will cause the system to hold s forever 
without releasing it. That (with a WeakHashTable) seems to correct the 
leaking problem but then we found sorting of the returned result broken, 
and the sorting begin to work immediately after we switch back to 
System.Intern(s).

I'm looking into the source code to understand why is so, any insight 
how to deal with the situation so we can keep the memory intact and the 
sort working? I also wonder if the new version (v2.3.0 or ?) will fix 
the memory leak so we don't need to change the source code?

Many Thanks in advance!
Min

Re: System.Intern(), memory leak, and sorting

Posted by Min Yin <yi...@AI.SRI.COM>.
In case I've completely confused people, it should be String.Intern() 
not System.Intern() I was talking about (don't know what I was thinking, 
probably the lunch :-P). It seems when using String.Intern(s) with the 
original source code, the comparison is done with (System.Object), but 
for s itself, the comparison should be done with (System.String) instead.

Min

Min Yin wrote:
> Thanks Digy, we've already applied that patch. We are replacing the 
> System.Intern() to try to stop additional leakage.
>
> Min
>
> Digy wrote:
>> Hi Min,
>>
>> Have you read http://issues.apache.org/jira/browse/LUCENENET-106?
>> Doesn't it solve the leakage problem(WeakHashTable+FieldCacheImpl.rar)?.
>>
>> DIGY
>>
>>
>> -----Original Message-----
>> From: Min Yin [mailto:yin@AI.SRI.COM] Sent: Tuesday, August 19, 2008 
>> 9:42 PM
>> To: lucene-net-user@incubator.apache.org
>> Subject: System.Intern(), memory leak, and sorting
>>
>> Hi there,
>>
>> In our attempt to fix the memory leaking (we are using v2.1.0), we 
>> replace all the System.Intern(s) with s itself in the source code. 
>> The theory being System.Intern(s) will cause the system to hold s 
>> forever without releasing it. That (with a WeakHashTable) seems to 
>> correct the leaking problem but then we found sorting of the returned 
>> result broken, and the sorting begin to work immediately after we 
>> switch back to System.Intern(s).
>>
>> I'm looking into the source code to understand why is so, any insight 
>> how to deal with the situation so we can keep the memory intact and 
>> the sort working? I also wonder if the new version (v2.3.0 or ?) will 
>> fix the memory leak so we don't need to change the source code?
>>
>> Many Thanks in advance!
>> Min
>>   


Re: System.Intern(), memory leak, and sorting

Posted by Min Yin <yi...@AI.SRI.COM>.
Thanks Digy, we've already applied that patch. We are replacing the 
System.Intern() to try to stop additional leakage.

Min

Digy wrote:
> Hi Min,
>
> Have you read http://issues.apache.org/jira/browse/LUCENENET-106?
> Doesn't it solve the leakage problem(WeakHashTable+FieldCacheImpl.rar)?.
>
> DIGY
>
>
> -----Original Message-----
> From: Min Yin [mailto:yin@AI.SRI.COM] 
> Sent: Tuesday, August 19, 2008 9:42 PM
> To: lucene-net-user@incubator.apache.org
> Subject: System.Intern(), memory leak, and sorting
>
> Hi there,
>
> In our attempt to fix the memory leaking (we are using v2.1.0), we 
> replace all the System.Intern(s) with s itself in the source code. The 
> theory being System.Intern(s) will cause the system to hold s forever 
> without releasing it. That (with a WeakHashTable) seems to correct the 
> leaking problem but then we found sorting of the returned result broken, 
> and the sorting begin to work immediately after we switch back to 
> System.Intern(s).
>
> I'm looking into the source code to understand why is so, any insight 
> how to deal with the situation so we can keep the memory intact and the 
> sort working? I also wonder if the new version (v2.3.0 or ?) will fix 
> the memory leak so we don't need to change the source code?
>
> Many Thanks in advance!
> Min
>   


RE: System.Intern(), memory leak, and sorting

Posted by Digy <di...@gmail.com>.
Hi Min,

Have you read http://issues.apache.org/jira/browse/LUCENENET-106?
Doesn't it solve the leakage problem(WeakHashTable+FieldCacheImpl.rar)?.

DIGY


-----Original Message-----
From: Min Yin [mailto:yin@AI.SRI.COM] 
Sent: Tuesday, August 19, 2008 9:42 PM
To: lucene-net-user@incubator.apache.org
Subject: System.Intern(), memory leak, and sorting

Hi there,

In our attempt to fix the memory leaking (we are using v2.1.0), we 
replace all the System.Intern(s) with s itself in the source code. The 
theory being System.Intern(s) will cause the system to hold s forever 
without releasing it. That (with a WeakHashTable) seems to correct the 
leaking problem but then we found sorting of the returned result broken, 
and the sorting begin to work immediately after we switch back to 
System.Intern(s).

I'm looking into the source code to understand why is so, any insight 
how to deal with the situation so we can keep the memory intact and the 
sort working? I also wonder if the new version (v2.3.0 or ?) will fix 
the memory leak so we don't need to change the source code?

Many Thanks in advance!
Min