Author: orbiter
Date: 2008-02-23 00:46:27 +0100 (Sat, 23 Feb 2008)
New Revision: 4502
Modified:
trunk/source/de/anomic/kelondro/kelondroEcoTable.java
Log:
stronger criteria to use RAM copy to use table copy
(should use less RAM)
Modified: trunk/source/de/anomic/kelondro/kelondroEcoTable.java
===================================================================
--- trunk/source/de/anomic/kelondro/kelondroEcoTable.java 2008-02-21
23:40:38 UTC (rev 4501)
+++ trunk/source/de/anomic/kelondro/kelondroEcoTable.java 2008-02-22
23:46:27 UTC (rev 4502)
@@ -59,7 +59,7 @@
public static final int tailCacheForceUsage = 1;
public static final int tailCacheUsageAuto = 2;
- public static final long maxarraylength = 134217727; // that may be the
maxmimum size of array length in some JVMs
+ public static final long maxarraylength = 134217727L; // that may be the
maxmimum size of array length in some JVMs
private kelondroRowSet table;
private kelondroBytesIntMap index;
@@ -97,7 +97,7 @@
// initialize index and copy table
int records = (int) Math.max(file.size(), initialSpace);
- long neededRAM4table = records * (rowdef.objectsize + 4) * 3 / 2;
+ long neededRAM4table = ((long) records) * (((long)
rowdef.objectsize) + 4L) * 3L;
table = ((neededRAM4table < maxarraylength) &&
((useTailCache == tailCacheForceUsage) ||
((useTailCache == tailCacheUsageAuto) &&
(Runtime.getRuntime().freeMemory() > neededRAM4table + 200 * 1024 * 1024)))) ?
_______________________________________________
YaCy-svn mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/yacy-svn