Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance
Java decentralizedintranet-searchintranet-search-enginep2pp2p-networkprivacyprivacy-protectionsearch-enginesearchenginewebweb-search-enginewebsearchwebseearch-engine
fix to rule when to use a ram table copy
orbiter3be54e18916f
diff --git a/source/de/anomic/data/Coordinates.java b/source/de/anomic/data/Coordinates.javaindex 88b5b1b0c..1c0681658 100644--- a/source/de/anomic/data/Coordinates.java+++ b/source/de/anomic/data/Coordinates.java@@ -60,7 +60,7 @@ public class Coordinates implements Comparable<Coordinates> {int lon1 = coord2int(this.lon) >> 15;int lat1 = coord2int(this.lat) >> 15;int h = (lon1 << 15) + lat1;- System.out.println("lon=" + this.lon + ", lat=" + this.lat + ", hash=" + h);+ //System.out.println("lon=" + this.lon + ", lat=" + this.lat + ", hash=" + h);return h;}diff --git a/source/de/anomic/kelondro/table/Table.java b/source/de/anomic/kelondro/table/Table.javaindex 16404fe53..d788f621d 100644--- a/source/de/anomic/kelondro/table/Table.java+++ b/source/de/anomic/kelondro/table/Table.java@@ -118,19 +118,19 @@ public class Table implements ObjectIndex {// initialize index and copy tablefinal int records = Math.max(fileSize, initialSpace);final long neededRAM4table = (records) * ((rowdef.objectsize) + 4L) * 3L;- table = ((neededRAM4table < maxarraylength) &&+ table = (/*(neededRAM4table < maxarraylength) &&*/((useTailCache == tailCacheForceUsage) ||- ((useTailCache == tailCacheUsageAuto) && (MemoryControl.free() > neededRAM4table + 200 * 1024 * 1024)))) ?+ ((useTailCache == tailCacheUsageAuto) && (MemoryControl.available() > neededRAM4table + 200 * 1024 * 1024)))) ?new RowSet(taildef, records) : null;- Log.logInfo("TABLE", "initialization of " + tablefile + ": available RAM: " + (MemoryControl.available() / 1024 / 1024) + "MB, allocating space for " + records + " entries");+ Log.logInfo("TABLE", "initialization of " + tablefile.getName() + ". table copy: " + ((table == null) ? "no" : "yes") + ", available RAM: " + (MemoryControl.available() / 1024 / 1024) + "MB, needed: " + (neededRAM4table/1024/1024 + 200) + "MB, allocating space for " + records + " entries");final long neededRAM4index = 2 * 1024 * 1024 + records * (rowdef.primaryKeyLength + 4) * 3 / 2;if (!MemoryControl.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// for the index- Log.logSevere("TABLE", tablefile + ": not enough RAM (" + (MemoryControl.available() / 1024 / 1024) + "MB) left for index, deleting allocated table space to enable index space allocation (needed: " + (neededRAM4index / 1024 / 1024) + "MB)");+ Log.logSevere("TABLE", tablefile.getName() + ": not enough RAM (" + (MemoryControl.available() / 1024 / 1024) + "MB) left for index, deleting allocated table space to enable index space allocation (needed: " + (neededRAM4index / 1024 / 1024) + "MB)");table = null; System.gc();- Log.logSevere("TABLE", tablefile + ": RAM after releasing the table: " + (MemoryControl.available() / 1024 / 1024) + "MB");+ Log.logSevere("TABLE", tablefile.getName() + ": RAM after releasing the table: " + (MemoryControl.available() / 1024 / 1024) + "MB");}index = new HandleMap(rowdef.primaryKeyLength, rowdef.objectOrder, 4, records, 100000);HandleMap errors = new HandleMap(rowdef.primaryKeyLength, NaturalOrder.naturalOrder, 4, records, 10);diff --git a/source/de/anomic/search/ResultFetcher.java b/source/de/anomic/search/ResultFetcher.javaindex 47cf70826..f01a9d96f 100644--- a/source/de/anomic/search/ResultFetcher.java+++ b/source/de/anomic/search/ResultFetcher.java@@ -293,7 +293,7 @@ public class ResultFetcher {//(event.query.onlineSnippetFetch) &&(this.rankedCache.size() > this.result.size())) {- // start worker threads to fetch urls and snippets+ // start worker threads to fetch urls and snippetsdeployWorker(query.neededResults());}