Index: oak-run/src/main/java/org/apache/jackrabbit/oak/run/SegmentTarUtils.java IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== --- oak-run/src/main/java/org/apache/jackrabbit/oak/run/SegmentTarUtils.java (date 1510607945000) +++ oak-run/src/main/java/org/apache/jackrabbit/oak/run/SegmentTarUtils.java (date 1510610028000) @@ -179,6 +179,7 @@ .withPath(directory) .withMmap(mmap) .withForce(force) + .withSegmentCacheSize(TAR_SEGMENT_CACHE_SIZE) .build() .run(); } Index: oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/tool/Compact.java IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== --- oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/tool/Compact.java (date 1510607945000) +++ oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/tool/Compact.java (date 1510610028000) @@ -18,6 +18,7 @@ package org.apache.jackrabbit.oak.segment.tool; import static com.google.common.base.Preconditions.checkNotNull; +import static org.apache.jackrabbit.oak.segment.SegmentCache.DEFAULT_SEGMENT_CACHE_MB; import static org.apache.jackrabbit.oak.segment.compaction.SegmentGCOptions.defaultGCOptions; import static org.apache.jackrabbit.oak.segment.file.FileStoreBuilder.fileStoreBuilder; @@ -60,6 +61,8 @@ private boolean force; + private int segmentCacheSize = DEFAULT_SEGMENT_CACHE_MB; + private Builder() { // Prevent external instantiation. } @@ -97,6 +100,11 @@ return this; } + public Builder withSegmentCacheSize(int segmentCacheSize) { + this.segmentCacheSize = segmentCacheSize; + return this; + } + /** * Create an executable version of the {@link Compact} command. * @@ -114,11 +122,14 @@ @CheckForNull private final Boolean mmap; + private final int segmentCacheSize; + private final boolean strictVersionCheck; private Compact(Builder builder) { this.path = builder.path; this.mmap = builder.mmap; + this.segmentCacheSize = builder.segmentCacheSize; this.strictVersionCheck = !builder.force; } @@ -157,6 +168,7 @@ private FileStore newFileStore() throws IOException, InvalidFileStoreVersionException { FileStoreBuilder fileStoreBuilder = fileStoreBuilder(path.getAbsoluteFile()) .withStrictVersionCheck(strictVersionCheck) + .withSegmentCacheSize(segmentCacheSize) .withGCOptions(defaultGCOptions() .setOffline() .setGCLogInterval(logAt));