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:
ahr
2017-12-23 09:42:08 +01:00
parent e59caa0f02
commit 888d25f7ea

View File

@@ -70,6 +70,7 @@ public class DataStore {
});
trimIntLists();
((ArrayList<Doc>)docIdToDoc).trimToSize();
}
private void cacheTagToFileMapping(final Tags tags, final Path path) {