List of usage examples for org.apache.lucene.index IndexWriterConfig setRAMPerThreadHardLimitMB
public IndexWriterConfig setRAMPerThreadHardLimitMB(int perThreadHardLimitMB)
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; }