Skip to content

Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance

removing the error-db upon each time a start-up is made. This is necessary because the table uses a lot of RAM and the content is never re-used after Start-Up.

orbiter8c06436c4ad9
diff --git a/source/de/anomic/plasma/crawler/plasmaCrawlQueues.java b/source/de/anomic/plasma/crawler/plasmaCrawlQueues.java
index fe3805497..7e5217f12 100644
--- a/source/de/anomic/plasma/crawler/plasmaCrawlQueues.java
+++ b/source/de/anomic/plasma/crawler/plasmaCrawlQueues.java
@@ -38,6 +38,7 @@ import java.util.Iterator;
import java.util.Map;
import de.anomic.data.robotsParser;
+import de.anomic.kelondro.kelondroFlexTable;
import de.anomic.plasma.plasmaCrawlEntry;
import de.anomic.plasma.plasmaCrawlNURL;
import de.anomic.plasma.plasmaCrawlProfile;
@@ -75,9 +76,14 @@ public class plasmaCrawlQueues {
log.logConfig("Starting Crawling Management");
noticeURL = new plasmaCrawlNURL(plasmaPath);
//errorURL = new plasmaCrawlZURL(); // fresh error DB each startup; can be hold in RAM and reduces IO;
+ File errorDBFile = new File(plasmaPath, "urlError2.db");
+ if (errorDBFile.exists()) {
+ // delete the error db to get a fresh each time on startup
+ // this is useful because there is currently no re-use of the data in this table.
+ if (errorDBFile.isDirectory()) kelondroFlexTable.delete(plasmaPath, "urlError2.db"); else errorDBFile.delete();
+ }
errorURL = new plasmaCrawlZURL(plasmaPath, "urlError2.db", false);
delegatedURL = new plasmaCrawlZURL(plasmaPath, "urlDelegated2.db", true);
-
}
public String urlExists(String hash) {
diff --git a/source/de/anomic/server/serverMemory.java b/source/de/anomic/server/serverMemory.java
index 297c07cac..890683be8 100644
--- a/source/de/anomic/server/serverMemory.java
+++ b/source/de/anomic/server/serverMemory.java
@@ -95,7 +95,7 @@ public class serverMemory {
* a Full GC to free enough RAM
* @return whether enough RAM is available
*/
- public static long available() {
+ public static final long available() {
// memory that is available including increasing total memory up to maximum
return runtime.maxMemory() - runtime.totalMemory() + runtime.freeMemory();
}