mirror of
https://github.com/yacy/yacy_search_server.git
synced 2024-09-21 00:00:13 +02:00
stronger criteria to use RAM copy to use table copy
(should use less RAM) git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@4502 6c8d7289-2bf4-0310-a012-ef5d649a1542
This commit is contained in:
parent
a7abee3578
commit
d477483373
|
@ -59,7 +59,7 @@ public class kelondroEcoTable implements kelondroIndex {
|
||||||
public static final int tailCacheForceUsage = 1;
|
public static final int tailCacheForceUsage = 1;
|
||||||
public static final int tailCacheUsageAuto = 2;
|
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 kelondroRowSet table;
|
||||||
private kelondroBytesIntMap index;
|
private kelondroBytesIntMap index;
|
||||||
|
@ -97,7 +97,7 @@ public class kelondroEcoTable implements kelondroIndex {
|
||||||
|
|
||||||
// initialize index and copy table
|
// initialize index and copy table
|
||||||
int records = (int) Math.max(file.size(), initialSpace);
|
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) &&
|
table = ((neededRAM4table < maxarraylength) &&
|
||||||
((useTailCache == tailCacheForceUsage) ||
|
((useTailCache == tailCacheForceUsage) ||
|
||||||
((useTailCache == tailCacheUsageAuto) && (Runtime.getRuntime().freeMemory() > neededRAM4table + 200 * 1024 * 1024)))) ?
|
((useTailCache == tailCacheUsageAuto) && (Runtime.getRuntime().freeMemory() > neededRAM4table + 200 * 1024 * 1024)))) ?
|
||||||
|
|
Loading…
Reference in New Issue
Block a user