lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From robert engels <reng...@ix.netcom.com>
Subject Re: [jira] Commented: (LUCENE-623) RAMDirectory.close() should have a comment about not releasing any resources
Date Sat, 08 Jul 2006 01:39:02 GMT
I don't think there is any leak at all. the problem was the caller  
was maintaining a reference to the reader after close was called  
(which prevents usage anyway), and wanted to free some of the  
underlying memory - kind of pointless, he should just release the ref  
to the IndexReader (since it is unusable anyway).

The patch was not needed.

On Jul 7, 2006, at 8:00 PM, Yonik Seeley (JIRA) wrote:

>     [ http://issues.apache.org/jira/browse/LUCENE-623? 
> page=comments#action_12419805 ]
>
> Yonik Seeley commented on LUCENE-623:
> -------------------------------------
>
> Just out of curiousity, does Lucene hold onto a RAMDirectory  
> instance somewhere after it has called close on it?  If so, that  
> would have been the ideal place to fix it any kind of "leak".
>
> This patch, while not doing much harm, is not really "best  
> practice" in Java and the existing RAMDirectory close() was correct.
> Am I missing something?
>
>> RAMDirectory.close() should have a comment about not releasing any  
>> resources
>> --------------------------------------------------------------------- 
>> -------
>>
>>          Key: LUCENE-623
>>          URL: http://issues.apache.org/jira/browse/LUCENE-623
>>      Project: Lucene - Java
>>         Type: Improvement
>
>>   Components: Store
>>     Versions: 1.9
>>     Reporter: Heng Mei
>>     Assignee: Hoss Man
>>     Priority: Minor
>>  Attachments: ramdirectory.diff
>>
>> I wrongly assumed that calling RAMDirectory.close() would free up  
>> the memory occupied by the RAMDirectory.
>> It might be helpful to add a javadoc comment that warns users that  
>> RAMDirectory.close() is a no-op, since it might be a common  
>> assumption that close() would release resources.
>
> -- 
> This message is automatically generated by JIRA.
> -
> If you think it was sent incorrectly contact one of the  
> administrators:
>    http://issues.apache.org/jira/secure/Administrators.jspa
> -
> For more information on JIRA, see:
>    http://www.atlassian.com/software/jira
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-dev-help@lucene.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


Mime
View raw message