X-Git-Url: https://gerrit.simantics.org/r/gitweb?p=simantics%2Fplatform.git;a=blobdiff_plain;f=bundles%2Forg.simantics.db.procore%2Fsrc%2Ffi%2Fvtt%2Fsimantics%2Fprocore%2Finternal%2FClusterTable.java;h=efb644acd78330df99bd86c305a1d21e73646ea7;hp=200e9e3c14f573478c4c50c2a3809266d77c5602;hb=892b7bb9be2147b5fe10036a75e798d184705339;hpb=493ad14d923a70f20b8abd3f5c57e270ac477f55 diff --git a/bundles/org.simantics.db.procore/src/fi/vtt/simantics/procore/internal/ClusterTable.java b/bundles/org.simantics.db.procore/src/fi/vtt/simantics/procore/internal/ClusterTable.java index 200e9e3c1..efb644acd 100644 --- a/bundles/org.simantics.db.procore/src/fi/vtt/simantics/procore/internal/ClusterTable.java +++ b/bundles/org.simantics.db.procore/src/fi/vtt/simantics/procore/internal/ClusterTable.java @@ -526,10 +526,11 @@ public final class ClusterTable implements IClusterTable { ArrayList toRelease = new ArrayList(); for (CollectorCluster cluster : support.getResidentClusters()) { - target -= support.getClusterSize(cluster); - if (target > 0) { - toRelease.add(cluster); - } else { + toRelease.add(cluster); + long clusterSize = support.getClusterSize(cluster); + //System.err.println("release cluster with " + (clusterSize/1024) + " kiB - " + cluster); + target -= clusterSize; + if (target <= 0) { break; } }