lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Yonik Seeley" <>
Subject Re: [jira] Commented: (LUCENE-623) RAMDirectory.close() should have a comment about not releasing any resources
Date Sun, 09 Jul 2006 15:43:57 GMT
On 7/9/06, Chris Hostetter <> wrote:
> : This patch, while not doing much harm, is not really "best practice" in
> : Java and the existing RAMDirectory close() was correct.
> Why is this not a best practice?  (or do you mean that in a "not
> particularly good" sense instead of "bad" sense?)

Right... some people used to null out references with the idea that it
would help out GC.  With modern VMs, it's normally a net performance
loss.  If the object you are releasing contains other references, one
should not normally null those references.

It only makes sense to null references when the lifetime of the parent
is greater.

-Yonik Solr, the open-source Lucene search server

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message