Directory directory = wrap(new RAMDirectory());
DirectoryReferenceFileGC gc = new DirectoryReferenceFileGC();
gc.init();
IndexInputCloser closer = new IndexInputCloser();
closer.init();
DirectoryReferenceCounter counter = new DirectoryReferenceCounter(directory, gc, closer);
IndexWriterConfig conf = new IndexWriterConfig(LUCENE_VERSION, new KeywordAnalyzer());
IndexWriter writer = new IndexWriter(counter, conf);
int size = 100;
IndexReader[] readers = new IndexReader[size];
for (int i = 0; i < size; i++) {