From eaad91d84fa95f232a6269479e6a4fb7824dce09 Mon Sep 17 00:00:00 2001 From: orbiter Date: Mon, 6 Nov 2006 15:53:42 +0000 Subject: [PATCH] fixed wrong RAM calculation git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@2928 6c8d7289-2bf4-0310-a012-ef5d649a1542 --- source/de/anomic/kelondro/kelondroFlexSplitTable.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/source/de/anomic/kelondro/kelondroFlexSplitTable.java b/source/de/anomic/kelondro/kelondroFlexSplitTable.java index 21248172c..0d9a653f1 100644 --- a/source/de/anomic/kelondro/kelondroFlexSplitTable.java +++ b/source/de/anomic/kelondro/kelondroFlexSplitTable.java @@ -97,18 +97,19 @@ public class kelondroFlexSplitTable implements kelondroIndex { // open next biggest table t.remove(maxf); date = maxf.substring(tablename.length() + 1); - if (maxram <= sum) { + if (buffersize >= maxram) { // this will cause usage of a complete RAM index table = new kelondroCache(new kelondroFlexTable(path, maxf, maxram, preloadTime, rowdef, objectOrder), maxram / 10, true, false); - sum -= maxram; - sum -= maxram / 10; + buffersize -= maxram; + buffersize -= maxram / 10; } else { // this will cause a generation of a file index - table = new kelondroFlexTable(path, maxf, sum / (t.size() + 1), preloadTime, rowdef, objectOrder); - sum -= sum / (t.size() + 1); + table = new kelondroFlexTable(path, maxf, buffersize / (t.size() + 1), preloadTime, rowdef, objectOrder); + buffersize -= buffersize / (t.size() + 1); } tables.put(date, table); } + System.out.println("*** remaining buffer RAM (not used): " + buffersize); } private static final Calendar thisCalendar = Calendar.getInstance();