LUCENE-623: RAMDirectory.close() now nulls out it's 'file' references

git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@419723 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Chris M. Hostetter 2006-07-06 22:14:07 +00:00
parent 13bb6026a7
commit b747b5c81d
3 changed files with 6 additions and 3 deletions

View File

@ -87,7 +87,9 @@ Optimizations
indexes. This will improve the performance of many types of queries
against a non-optimized index. (Andrew Hudson via Yonik Seeley)
2. LUCENE-623: RAMDirectory.close now nulls out it's reference to all
internal "files", allowing them to be GCed even if references to the
RAMDirectory itself still exist. (Nadav Har'El via Chris Hostetter)
Release 2.0.0 2006-05-26

View File

@ -198,7 +198,8 @@ public final class RAMDirectory extends Directory implements Serializable {
};
}
/** Closes the store to future operations. */
/** Closes the store to future operations, releasing associated memory. */
public final void close() {
files = null;
}
}

View File

@ -61,9 +61,9 @@ public class TestIndexWriterMerging extends TestCase
writer.addIndexes(new Directory[]{indexA, indexB});
writer.close();
merged.close();
fail = verifyIndex(merged, 0);
merged.close();
assertFalse("The merged index is invalid", fail);
}