Example usage for org.apache.lucene.index IndexWriterConfig setRAMPerThreadHardLimitMB

List of usage examples for org.apache.lucene.index IndexWriterConfig setRAMPerThreadHardLimitMB

Introduction

In this page you can find the example usage for org.apache.lucene.index IndexWriterConfig setRAMPerThreadHardLimitMB.

Prototype

public IndexWriterConfig setRAMPerThreadHardLimitMB(int perThreadHardLimitMB) 

Source Link

Document

Expert: Sets the maximum memory consumption per thread triggering a forced flush if exceeded.

Usage

From source file:de.walware.statet.r.internal.core.rhelp.index.REnvIndexWriter.java

License:Open Source License

private IndexWriterConfig createWriterConfig() {
    final IndexWriterConfig config = new IndexWriterConfig(Version.LATEST, WRITE_ANALYZER);
    config.setSimilarity(SIMILARITY);/*from w  w w. j av a 2 s .c om*/
    config.setMaxThreadStates(Math.min(Math.max(2, Runtime.getRuntime().availableProcessors() - 3), 8));
    config.setRAMPerThreadHardLimitMB(512);
    return config;
}