diff --git a/asterix-common/src/main/java/edu/uci/ics/asterix/common/context/DatasetLifecycleManager.java b/asterix-common/src/main/java/edu/uci/ics/asterix/common/context/DatasetLifecycleManager.java
index 434835b..d7329bf 100644
--- a/asterix-common/src/main/java/edu/uci/ics/asterix/common/context/DatasetLifecycleManager.java
+++ b/asterix-common/src/main/java/edu/uci/ics/asterix/common/context/DatasetLifecycleManager.java
@@ -144,23 +144,28 @@
     }
 
     private boolean evictCandidateDataset() throws HyracksDataException {
-        // Why min()? As a heuristic for eviction, we will take an open index (an index consuming memory) 
+        // We will take a dataset that has no active transactions, it is open (a dataset consuming memory), 
         // that is not being used (refcount == 0) and has been least recently used. The sort order defined 
-        // for IndexInfo maintains this. See IndexInfo.compareTo().
-        DatasetInfo dsInfo = Collections.min(datasetInfos.values());
-        if (dsInfo.referenceCount == 0 && dsInfo.isOpen) {
-            for (IndexInfo iInfo : dsInfo.indexes.values()) {
-                if (iInfo.isOpen) {
-                    iInfo.index.deactivate(true);
-                    iInfo.isOpen = false;
-                }
-                assert iInfo.referenceCount == 0;
-            }
+        // for DatasetInfo maintains this. See DatasetInfo.compareTo().
 
-            IVirtualBufferCache vbc = getVirtualBufferCache(dsInfo.datasetID);
-            used -= vbc.getNumPages() * vbc.getPageSize();
-            dsInfo.isOpen = false;
-            return true;
+        List<DatasetInfo> datasetInfosList = new ArrayList<DatasetInfo>(datasetInfos.values());
+        Collections.sort(datasetInfosList);
+        for (DatasetInfo dsInfo : datasetInfosList) {
+            if (((PrimaryIndexOperationTracker) datasetOpTrackers.get(dsInfo.datasetID)).getNumActiveOperations() == 0
+                    && dsInfo.referenceCount == 0 && dsInfo.isOpen) {
+                for (IndexInfo iInfo : dsInfo.indexes.values()) {
+                    if (iInfo.isOpen) {
+                        iInfo.index.deactivate(true);
+                        iInfo.isOpen = false;
+                    }
+                    assert iInfo.referenceCount == 0;
+                }
+
+                IVirtualBufferCache vbc = getVirtualBufferCache(dsInfo.datasetID);
+                used -= vbc.getNumPages() * vbc.getPageSize();
+                dsInfo.isOpen = false;
+                return true;
+            }
         }
         return false;
     }
diff --git a/asterix-common/src/main/java/edu/uci/ics/asterix/common/context/PrimaryIndexOperationTracker.java b/asterix-common/src/main/java/edu/uci/ics/asterix/common/context/PrimaryIndexOperationTracker.java
index b924024..1a82d75 100644
--- a/asterix-common/src/main/java/edu/uci/ics/asterix/common/context/PrimaryIndexOperationTracker.java
+++ b/asterix-common/src/main/java/edu/uci/ics/asterix/common/context/PrimaryIndexOperationTracker.java
@@ -113,4 +113,8 @@
         }
     }
 
+    public int getNumActiveOperations() {
+        return numActiveOperations.get();
+    }
+
 }
