trim docIdToDoc list
This reduces memory usage by 1 or 2 MB. 33% of an ArrayList can be free. If the list is 1 million entries long, then the list wastes 2.6 MB. The Doc objects in the list are much bigger.
This commit is contained in:
@@ -70,6 +70,7 @@ public class DataStore {
|
|||||||
|
|
||||||
});
|
});
|
||||||
trimIntLists();
|
trimIntLists();
|
||||||
|
((ArrayList<Doc>)docIdToDoc).trimToSize();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void cacheTagToFileMapping(final Tags tags, final Path path) {
|
private void cacheTagToFileMapping(final Tags tags, final Path path) {
|
||||||
|
|||||||
Reference in New Issue
Block a user