lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nadav Har'El (JIRA)" <>
Subject [jira] Updated: (LUCENE-623) RAMDirectory.close() should have a comment about not releasing any resources
Date Thu, 06 Jul 2006 10:47:32 GMT
     [ ]

Nadav Har'El updated LUCENE-623:

    Attachment: ramdirectory.diff

I propose a trivial patch, which does two very simple things:

1. RAMDirectory.close(), instead of being a no-op, sets files=null. This allows the garbage
collector to collect all the memory that was used for this RAMDirectory (this is the best
we can do in Java).

2. Make the documentation more explicit, from "Closes the store to future operations." to
"Closes the store to future operations, releasing associated memory."

Note that now, after a close(), any operations on the RAMDirectory will likely result in a
NullPointerException. I don't think this matters, as the documentation clearly says that after
a close() you're not allowed to operate on this object.

> RAMDirectory.close() should have a comment about not releasing any resources
> ----------------------------------------------------------------------------
>          Key: LUCENE-623
>          URL:
>      Project: Lucene - Java
>         Type: Improvement

>   Components: Store
>     Versions: 1.9
>     Reporter: Heng Mei
>     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:
For more information on JIRA, see:

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

View raw message