mirror of https://github.com/apache/lucene.git
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:
parent
13bb6026a7
commit
b747b5c81d
|
@ -87,7 +87,9 @@ Optimizations
|
||||||
indexes. This will improve the performance of many types of queries
|
indexes. This will improve the performance of many types of queries
|
||||||
against a non-optimized index. (Andrew Hudson via Yonik Seeley)
|
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
|
Release 2.0.0 2006-05-26
|
||||||
|
|
||||||
|
|
|
@ -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() {
|
public final void close() {
|
||||||
|
files = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -61,9 +61,9 @@ public class TestIndexWriterMerging extends TestCase
|
||||||
|
|
||||||
writer.addIndexes(new Directory[]{indexA, indexB});
|
writer.addIndexes(new Directory[]{indexA, indexB});
|
||||||
writer.close();
|
writer.close();
|
||||||
merged.close();
|
|
||||||
|
|
||||||
fail = verifyIndex(merged, 0);
|
fail = verifyIndex(merged, 0);
|
||||||
|
merged.close();
|
||||||
|
|
||||||
assertFalse("The merged index is invalid", fail);
|
assertFalse("The merged index is invalid", fail);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue