From 249d61759a4dfe41e7bdd813babe498ff07c5f16 Mon Sep 17 00:00:00 2001 From: orbiter Date: Mon, 4 Feb 2008 10:33:45 +0000 Subject: [PATCH] fix for false RAM table activation in EcoTables git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@4441 6c8d7289-2bf4-0310-a012-ef5d649a1542 --- source/de/anomic/kelondro/kelondroEcoTable.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source/de/anomic/kelondro/kelondroEcoTable.java b/source/de/anomic/kelondro/kelondroEcoTable.java index 1bd8695f8..c044b6061 100644 --- a/source/de/anomic/kelondro/kelondroEcoTable.java +++ b/source/de/anomic/kelondro/kelondroEcoTable.java @@ -97,13 +97,13 @@ public class kelondroEcoTable implements kelondroIndex { // initialize index and copy table int records = (int) Math.max(file.size(), initialSpace); - long neededRAM4table = 200 * 1024 * 1024 + records * (rowdef.objectsize + 4) * 3 / 2; + long neededRAM4table = records * (rowdef.objectsize + 4) * 3 / 2; table = ((neededRAM4table < maxarraylength) && ((useTailCache == tailCacheForceUsage) || - ((useTailCache == tailCacheUsageAuto) && (serverMemory.request(neededRAM4table, false))))) ? + ((useTailCache == tailCacheUsageAuto) && (serverMemory.request(neededRAM4table + 200 * 1024 * 1024, false))))) ? new kelondroRowSet(taildef, records) : null; System.out.println("*** DEBUG " + tablefile + ": available RAM: " + (serverMemory.available() / 1024 / 1024) + "MB, allocating space for " + records + " entries"); - long neededRAM4index = 200 * 1024 * 1024 + records * (rowdef.primaryKeyLength + 4) * 3 / 2; + long neededRAM4index = 2 * 1024 * 1024 + records * (rowdef.primaryKeyLength + 4) * 3 / 2; if (!serverMemory.request(neededRAM4index, false)) { // despite calculations seemed to show that there is enough memory for the table AND the index // there is now not enough memory left for the index. So delete the table again to free the memory