From 0002abd5838689f3e6b8d850b31c4f3b3e54d201 Mon Sep 17 00:00:00 2001 From: orbiter Date: Wed, 22 Jan 2014 20:54:03 +0100 Subject: [PATCH] fix for OOM during remote search and too high load protection --- source/net/yacy/peers/RemoteSearch.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/source/net/yacy/peers/RemoteSearch.java b/source/net/yacy/peers/RemoteSearch.java index 067f83160..3e699e8f4 100644 --- a/source/net/yacy/peers/RemoteSearch.java +++ b/source/net/yacy/peers/RemoteSearch.java @@ -211,15 +211,17 @@ public class RemoteSearch extends Thread { if (!Switchboard.getSwitchboard().getConfigBool(SwitchboardConstants.DEBUG_SEARCH_REMOTE_SOLR_OFF, false)) { final SolrQuery solrQuery = event.query.solrQuery(event.getQuery().contentdom, start == 0, event.excludeintext_image); for (Seed s: robinsonPeers) { - Thread t = solrRemoteSearch(event, solrQuery, start, count, s, targets, blacklist); - event.nodeSearchThreads.add(t); - } + if (MemoryControl.shortStatus() || Memory.load() > 4.0) continue; + Thread t = solrRemoteSearch(event, solrQuery, start, count, s, targets, blacklist); + event.nodeSearchThreads.add(t); } + } // start search to YaCy DHT peers if (!Switchboard.getSwitchboard().getConfigBool(SwitchboardConstants.DEBUG_SEARCH_REMOTE_DHT_OFF, false)) { for (Seed dhtPeer: dhtPeers) { if (dhtPeer == null || dhtPeer.hash == null) continue; + if (MemoryControl.shortStatus() || Memory.load() > 8.0) continue; try { RemoteSearch rs = new RemoteSearch( event,