From ba9798dcb71fe4a8340fa5d33bfc4e6620c68c29 Mon Sep 17 00:00:00 2001 From: orbiter Date: Sun, 14 May 2006 17:19:43 +0000 Subject: [PATCH] better fix for http://www.yacy-forum.de/viewtopic.php?t=2370 git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@2093 6c8d7289-2bf4-0310-a012-ef5d649a1542 --- htroot/PerformanceMemory_p.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/htroot/PerformanceMemory_p.java b/htroot/PerformanceMemory_p.java index 52e841a73..92719356d 100644 --- a/htroot/PerformanceMemory_p.java +++ b/htroot/PerformanceMemory_p.java @@ -59,8 +59,8 @@ import de.anomic.yacy.yacyCore; public class PerformanceMemory_p { - private static final int KB = 1024; - private static final int MB = 1024 * KB; + private static final long KB = 1024; + private static final long MB = 1024 * KB; private static Map defaultSettings = null; private static long[] slt,chk; @@ -291,9 +291,9 @@ public class PerformanceMemory_p { } private static void putprop(serverObjects prop, serverSwitch env, String db, String set) { - usd = chk[0]*slt[3] + chk[1]*slt[2] + chk[2]*slt[1]; - bst = (((chk[2] * req) >> 10) + 1) << 10; - god = (((bst / (1+slt[1]+slt[2]+slt[3]) * slt[1]) >> 10) + 1) << 10; + usd = ((long) chk[0]) * ((long) slt[3]) + ((long) chk[1]) * ((long) slt[2]) + ((long) chk[2]) * ((long) slt[1]); + bst = (((((long) chk[2]) * ((long) req)) >> 10) + 1) << 10; + god = (((((long) bst) / ((long) (1+slt[1]+slt[2]+slt[3])) * ((long) slt[1])) >> 10) + 1) << 10; if (set.equals("setGood")) env.setConfig("ramCache" + db, god); if (set.equals("setBest")) env.setConfig("ramCache" + db, bst); prop.put("chunk" + db, chk[2] + "/" + chk[1] + "/" + chk[0]);