more logging for OOMs

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@7534 6c8d7289-2bf4-0310-a012-ef5d649a1542
This commit is contained in:
orbiter 2011-02-26 09:27:15 +00:00
parent b1781d7aae
commit 89d337841c
3 changed files with 6 additions and 1 deletions

View File

@ -731,11 +731,13 @@ public final class serverCore extends AbstractBusyThread implements BusyThread {
try {
result = commandMethod.invoke(this.commandObj, parameter);
} catch (OutOfMemoryError e) {
log.logWarning("commandMethod.invoke: OutOfMemoryError / 1 (retry1 follows)");
// try again
terminateOldSessions(2000);
try {
result = commandMethod.invoke(this.commandObj, parameter);
} catch (OutOfMemoryError e2) {
log.logWarning("commandMethod.invoke: OutOfMemoryError / 2 (retry2 follows)");
// try again
Thread.sleep(1000);
result = commandMethod.invoke(this.commandObj, parameter);

View File

@ -191,7 +191,7 @@ public class yacySearch extends Thread {
indexSegment, peers, containerCache, secondarySearchSuperviser, blacklist, rankingProfile, constraint);
searchThreads[i].start();
} catch (OutOfMemoryError e) {
e.printStackTrace();
Log.logException(e);
break;
}
}

View File

@ -34,6 +34,8 @@ import java.util.concurrent.Future;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;
import net.yacy.kelondro.logging.Log;
import jcifs.smb.SmbException;
import jcifs.smb.SmbFile;
@ -86,6 +88,7 @@ public class TimeoutRequest<E> {
throw new ExecutionException(e);
}
} catch (OutOfMemoryError e) {
Log.logWarning("TimeoutRequest.call", "OutOfMemoryError / retry follows", e);
// in case that no memory is there to create a new native thread
try {
return this.call.call();