Author: mduerig
Date: Tue Sep  6 12:02:20 2016
New Revision: 1759414

URL: http://svn.apache.org/viewvc?rev=1759414&view=rev
Log:
OAK-4281: Rework memory estimation for compaction
Remove memory estimation entirely

Modified:
    
jackrabbit/oak/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/file/FileStore.java

Modified: 
jackrabbit/oak/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/file/FileStore.java
URL: 
http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/file/FileStore.java?rev=1759414&r1=1759413&r2=1759414&view=diff
==============================================================================
--- 
jackrabbit/oak/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/file/FileStore.java
 (original)
+++ 
jackrabbit/oak/trunk/oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/file/FileStore.java
 Tue Sep  6 12:02:20 2016
@@ -52,7 +52,6 @@ import java.text.DecimalFormat;
 import java.text.DecimalFormatSymbols;
 import java.util.Arrays;
 import java.util.HashMap;
-import java.util.Iterator;
 import java.util.LinkedList;
 import java.util.List;
 import java.util.Map;
@@ -501,26 +500,6 @@ public class FileStore implements Segmen
 
     public void maybeCompact(boolean cleanup) throws IOException {
         gcListener.info("TarMK GC #{}: started", GC_COUNT.incrementAndGet());
-
-        Runtime runtime = Runtime.getRuntime();
-        long avail = runtime.totalMemory() - runtime.freeMemory();
-        // FIXME OAK-4281: Rework memory estimation for compaction
-        // What value should we use for delta?
-        long delta = 0;
-        long needed = delta * gcOptions.getMemoryThreshold();
-        if (needed >= avail) {
-            gcListener.skipped(
-                    "TarMK GC #{}: not enough available memory {} ({} bytes), 
needed {} ({} bytes)," +
-                    " last merge delta {} ({} bytes), so skipping compaction 
for now",
-                    GC_COUNT,
-                    humanReadableByteCount(avail), avail,
-                    humanReadableByteCount(needed), needed,
-                    humanReadableByteCount(delta), delta);
-            if (cleanup) {
-                cleanupNeeded.set(!gcOptions.isPaused());
-            }
-        }
-
         Stopwatch watch = Stopwatch.createStarted();
 
         int gainThreshold = gcOptions.getGainThreshold();


Reply via email to