Skip to content

Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance

clear some caches before reporting low Memory do not break lines in Network-table-rows

sixcooler7f501b7c3887
diff --git a/htroot/Network.html b/htroot/Network.html
index 8c3ac7924..d4ad9192f 100644
--- a/htroot/Network.html
+++ b/htroot/Network.html
@@ -136,7 +136,7 @@ To see a list of all APIs, please visit the <a href="http://www.yacy-websuche.de
</tr>
#{list}#
<tr class="TableCell#(dark)#Light::Dark::Summary#(/dark)#">
- <td>
+ <td><nobr>
<a href="MessageSend_p.html?hash=#[hash]#" title="Send message to peer #[fullname]#">m</a>&nbsp;
<a href="ViewProfile.html?hash=#[hash]#&amp;display=1" title="View profile of peer #[fullname]#">p</a>&nbsp;
<a href="http://#[fullname]#.yacy/Wiki.html" title="Read and edit wiki on peer #[fullname]#">w</a>&nbsp;
@@ -145,7 +145,7 @@ To see a list of all APIs, please visit the <a href="http://www.yacy-websuche.de
#(updatedWiki)#::<a href="http://#[address]#/Wiki.html?page=#[page]#" title="#[page]#"><img src="/env/grafics/wiki.gif" width="54" height="11" alt="Wiki updated" /></a>#(/updatedWiki)#
#(updatedBlog)#::<a href="http://#[address]#/Blog.html?page=#[page]#" title="#[subject]#"><img src="/env/grafics/blog.gif" width="54" height="11" alt="Blog updated" /></a>#(/updatedBlog)#
#(isCrawling)#::<a href="#[page]#"><img src="/env/grafics/crawl.gif" width="54" height="11" alt="Crawl" /></a>#(/isCrawling)#
- </td>
+ </nobr></td>
<td #(special)#::class="TableCellActive"#(/special)#><a href="http://www.#[fullname]#.yacy">#[shortname]#</a>#(ssl)#::<img src="/env/grafics/lock.gif" width="11" height="15" title="https supported" alt="https supported" />#(/ssl)#</td>
<td nowrap>
#(type)##(direct)#<img src="/env/grafics/JuniorPassive.gif" width="11" height="11" title="Type: Junior | Contact: passive" alt="Junior passive" />::<img src="/env/grafics/JuniorDirect.gif" width="11" height="11" title="Type: Junior | Contact: direct" alt="Junior direct" />::<img src="/env/grafics/JuniorOffline.gif" width="11" height="11" title="Type: Junior | Contact: offline" alt="Junior offline" />#(/direct)#::#(direct)#<img src="/env/grafics/SeniorPassive.gif" width="11" height="11" title="Type: Senior | Contact: passive" alt="senior passive" />::<img src="/env/grafics/SeniorDirect.gif" width="11" height="11" title="Type: Senior | Contact: direct" alt="Senior direct" />::<img src="/env/grafics/SeniorOffline.gif" width="11" height="11" title="Type: Senior | Contact: offline" alt="Senior offline" />#(/direct)#::<a href="#[url]#">#(direct)#<img src="/env/grafics/PrincipalPassive.gif" width="11" height="11" title="Type: Principal | Contact: passive | Seed download: possible" alt="Principal passive" />::<img src="/env/grafics/PrincipalDirect.gif" width="11" height="11" title="Type: Principal | Contact: direct | Seed download: possible" alt="Principal active" />::<img src="/env/grafics/PrincipalOffline.gif" width="11" height="11" title="Type: Principal | Contact: offline | Seed download: ?" alt="Principal offline" />#(/direct)#</a>#(/type)##(acceptcrawl)#<img src="/env/grafics/CrawlNo.gif" width="11" height="11" title="Accept Crawl: no" alt="no crawl" />::<img src="/env/grafics/CrawlYes.gif" width="11" height="11" title="Accept Crawl: yes" alt="crawl possible" />::<img src="/env/grafics/CrawlYesOffline.gif" width="11" height="11" title="Accept Crawl: yes" alt="crawl possible" />#(/acceptcrawl)##(dhtreceive)#<img src="/env/grafics/DHTReceiveNo.gif" width="11" height="11" title="DHT Receive: no; #[peertags]#" alt="no DHT receive" />::<img src="/env/grafics/DHTReceiveYes.gif" width="11" height="11" title="DHT Receive: yes" alt="DHT receive enabled" />::<img src="/env/grafics/DHTReceiveYesOffline.gif" width="11" height="11" title="DHT Receive: yes" alt="DHT receive enabled" />#(/dhtreceive)##(nodestate)#<img src="/env/grafics/RootStateNo.gif" width="11" height="11" title="Not a Node Candidate" alt="no node candidate" />::<a href="http://#[ip]#:#[port]#/Network.html?page=1"><img src="/env/grafics/RootStateYes.gif" width="11" height="11" title="Node Candidate" alt="node candidate" /></a>#(/nodestate)#</td>
@@ -384,4 +384,4 @@ To see a list of all APIs, please visit the <a href="http://www.yacy-websuche.de
#(/table)#
#%env/templates/footer.template%#
</body>
-</html>
\ No newline at end of file
+</html>
diff --git a/source/net/yacy/search/ResourceObserver.java b/source/net/yacy/search/ResourceObserver.java
index 7a5abb6a8..9cc6a58e7 100644
--- a/source/net/yacy/search/ResourceObserver.java
+++ b/source/net/yacy/search/ResourceObserver.java
@@ -87,15 +87,6 @@ public class ResourceObserver {
this.sb.peers.mySeed().setFlagAcceptRemoteIndex(false);
this.sb.setConfig(SwitchboardConstants.INDEX_RECEIVE_AUTODISABLED, true);
}
- if (this.normalizedMemoryFree.compareTo(Space.HIGH) < 0 ) {
- // clear some caches - @all: are there more of these, we could clear here?
- this.sb.index.clearCache();
- SearchEventCache.cleanupEvents(true);
- this.sb.trail.clear();
- Switchboard.urlBlacklist.clearblacklistCache();
- WordCache.clearCommonWords();
- Domains.clear();
- }
}
else {
@@ -135,8 +126,17 @@ public class ResourceObserver {
}
private Space getNormalizedMemoryFree() {
- if(!MemoryControl.properState()) return Space.LOW;
- return Space.HIGH;
+ if(MemoryControl.properState()) return Space.HIGH;
+
+ // clear some caches - @all: are there more of these, we could clear here?
+ this.sb.index.clearCache();
+ SearchEventCache.cleanupEvents(true);
+ this.sb.trail.clear();
+ Switchboard.urlBlacklist.clearblacklistCache();
+ WordCache.clearCommonWords();
+ Domains.clear();
+
+ return MemoryControl.properState()? Space.HIGH : Space.LOW;
}
/**