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
pull/1/head
orbiter 17 years ago
parent 4fdf695064
commit 8c06436c4a

@ -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) {

@ -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();
}

Loading…
Cancel
Save