Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance
Java decentralizedintranet-searchintranet-search-enginep2pp2p-networkprivacyprivacy-protectionsearch-enginesearchenginewebweb-search-enginewebsearchwebseearch-engine
- callback fix - memory allocation problem in RowCollection: if memory is too low, do not to try to increase by 1 because this leads to very long execution time and at the end to the same OOM as if we allocate the memory at the moment we need it even if the resource observer states that this memory is not there. To compensate this, the increase size is reduced.
Michael Peter Christen342ba1049b14
diff --git a/htroot/portalsearch/yacy-portalsearch.js b/htroot/portalsearch/yacy-portalsearch.jsindex dbaf9d6ed..8121347e5 100644--- a/htroot/portalsearch/yacy-portalsearch.js+++ b/htroot/portalsearch/yacy-portalsearch.js@@ -207,7 +207,7 @@ function yrun() {function yacysearch(clear) {var url = yconf.url + '/yacysearch.json?callback=?' // JSONP (cross domain) request URL- //var url = yconf.url + '/solr/select?wt=yjson&jsonp=?' // JSONP (cross domain) request URL+ //var url = yconf.url + '/solr/select?wt=yjson&callback=?' // JSONP (cross domain) request URLif(clear) {$('#ypopup').empty();diff --git a/source/net/yacy/kelondro/index/RowCollection.java b/source/net/yacy/kelondro/index/RowCollection.javaindex 523bad0e4..065c641a0 100644--- a/source/net/yacy/kelondro/index/RowCollection.java+++ b/source/net/yacy/kelondro/index/RowCollection.java@@ -54,7 +54,7 @@ public class RowCollection implements Sortable<Row.Entry>, Iterable<Row.Entry>,private static final byte[] EMPTY_CACHE = new byte[0];public static final long growfactorLarge100 = 140L;- public static final long growfactorSmall100 = 120L;+ public static final long growfactorSmall100 = 110L;private static final int isortlimit = 20;private static final int exp_chunkcount = 0;@@ -246,12 +246,11 @@ public class RowCollection implements Sortable<Row.Entry>, Iterable<Row.Entry>,long allocram = needed * growfactorLarge100 / 100L;allocram -= allocram % this.rowdef.objectsize;assert allocram > 0 : "elements = " + elements + ", new = " + allocram;- if (allocram <= Integer.MAX_VALUE && MemoryControl.request(allocram, false)) return allocram;+ if (allocram <= Integer.MAX_VALUE && MemoryControl.request(allocram, forcegc)) return allocram;allocram = needed * growfactorSmall100 / 100L;allocram -= allocram % this.rowdef.objectsize;assert allocram >= 0 : "elements = " + elements + ", new = " + allocram;- if (allocram <= Integer.MAX_VALUE && MemoryControl.request(allocram, forcegc)) return allocram;- return needed;+ return allocram;}private final void ensureSize(final int elements) throws SpaceExceededException {