Skip to content

Commit

Permalink
less OOM (works for me)
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@4194 6c8d7289-2bf4-0310-a012-ef5d649a1542
  • Loading branch information
borg-0300 committed Nov 2, 2007
1 parent 794d296 commit a5d2878
Show file tree
Hide file tree
Showing 7 changed files with 2,325 additions and 2,288 deletions.
11 changes: 6 additions & 5 deletions source/de/anomic/index/indexRAMRI.java
Expand Up @@ -4,9 +4,9 @@
//
// This is a part of YaCy, a peer-to-peer based web search engine
//
// $LastChangedDate: 2006-04-02 22:40:07 +0200 (So, 02 Apr 2006) $
// $LastChangedRevision: 1986 $
// $LastChangedBy: orbiter $
// $LastChangedDate$
// $LastChangedRevision$
// $LastChangedBy$
//
// LICENSE
//
Expand Down Expand Up @@ -45,6 +45,7 @@
import de.anomic.kelondro.kelondroRow;
import de.anomic.server.serverByteBuffer;
import de.anomic.server.serverFileUtils;
import de.anomic.server.serverMemory;
import de.anomic.server.logging.serverLog;
import de.anomic.yacy.yacySeedDB;

Expand Down Expand Up @@ -160,7 +161,7 @@ private void dump() throws IOException {

// write a log
if (System.currentTimeMillis() > messageTime) {
// System.gc(); // for better statistic
serverMemory.gc(1000, "indexRAMRI, for better statistic-1"); // for better statistic - thq
wordsPerSecond = wordcount * 1000
/ (1 + System.currentTimeMillis() - startTime);
log.logInfo("dump status: " + wordcount
Expand Down Expand Up @@ -222,7 +223,7 @@ private long restore() throws IOException {
//while (rt.freeMemory() < 1000000) {flushFromMem(); java.lang.System.gc();}
// write a log
if (System.currentTimeMillis() > messageTime) {
System.gc(); // for better statistic
serverMemory.gc(1000, "indexRAMRI, for better statistic-2"); // for better statistic - thq
urlsPerSecond = 1 + urlCount * 1000 / (1 + System.currentTimeMillis() - startTime);
log.logInfo("restoring status: " + urlCount + " urls done, " + ((dumpArray.size() - urlCount) / urlsPerSecond) + " seconds remaining, free mem = " + (Runtime.getRuntime().freeMemory() / 1024 / 1024) + "MB");
messageTime = System.currentTimeMillis() + 5000;
Expand Down

0 comments on commit a5d2878

Please sign in to comment.