From 8c06436c4ad9593c56ed72564d82f6b0f53b3009 Mon Sep 17 00:00:00 2001 From: orbiter Date: Sat, 1 Mar 2008 09:44:33 +0000 Subject: [PATCH] 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. git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@4520 6c8d7289-2bf4-0310-a012-ef5d649a1542 --- source/de/anomic/plasma/crawler/plasmaCrawlQueues.java | 8 +++++++- source/de/anomic/server/serverMemory.java | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) 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(); }