Skip to content

Commit

Permalink
Merge pull request #6645 from tinwelint/2.3-min-import-page-size
Browse files Browse the repository at this point in the history
Respects page cache min memory size in import
  • Loading branch information
Max Sumrall committed Mar 10, 2016
2 parents 05f24fe + 921486c commit f77be36
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
import org.neo4j.unsafe.impl.batchimport.store.BatchingTokenRepository.BatchingRelationshipTypeTokenRepository;
import org.neo4j.unsafe.impl.batchimport.store.io.IoTracer;

import static java.lang.Math.max;
import static java.lang.Math.min;
import static java.lang.String.valueOf;

Expand Down Expand Up @@ -98,9 +99,12 @@ public BatchingNeoStores( FileSystemAbstraction fileSystem, File storeDir, Confi
// Having less than that might result in an evicted page will reading, which would mean
// unnecessary re-reading. Having slightly more leaves some leg room.
long optimalMappedMemorySize = pageSize * 40;
long limitedMemorySize = max(
2 * pageSize, // page cache requires at the very least memory enough for two pages
applyEnvironmentLimitationsTo( optimalMappedMemorySize ) );
this.neo4jConfig = new Config( stringMap( dbConfig.getParams(),
dense_node_threshold.name(), valueOf( config.denseNodeThreshold() ),
pagecache_memory.name(), valueOf( applyEnvironmentLimitationsTo( optimalMappedMemorySize ) ),
pagecache_memory.name(), valueOf( limitedMemorySize ),
mapped_memory_page_size.name(), valueOf( pageSize ) ),
GraphDatabaseSettings.class );
final PageCacheTracer tracer = new DefaultPageCacheTracer();
Expand Down

0 comments on commit f77be36

Please sign in to comment.