Description
The FileStore keeps a reference to all TarReader object, one per each file. In my test, for an ~350 Gb repository, that was ~1100 tar files, with a TarReader for each.
The problem is TarReader keeps a reference to a precomputed graph ByteBuffer, which is not really used that much. That means that through the readers field, there's a reference to these graphs, which means they can't be GC'ed.
The construction of FileStore is from oak-run:
FileStore store = new FileStore(directory, 256, TAR_STORAGE_MEMORY_MAPPED);
The effect is you need more that 6GB of Ram just to instantiate the FileStore object.
The attached patch fixes this issue.