- 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.
pull/1/head
Michael Peter Christen 12 years ago
parent 65d73e5652
commit 342ba1049b

@ -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 URL
if(clear) {
$('#ypopup').empty();

@ -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 {

Loading…
Cancel
Save