tried to fix 100% CPU when calling Balancer.top()

see also: http://forum.yacy-websuche.de/viewtopic.php?p=19978#p19978

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@6844 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
orbiter 15 years ago
parent b6cce08019
commit 40a8d132d9

@ -507,8 +507,10 @@ public class Balancer {
count = Math.min(count, top.size()); count = Math.min(count, top.size());
final ArrayList<Request> cel = new ArrayList<Request>(); final ArrayList<Request> cel = new ArrayList<Request>();
if (count == 0) return cel; if (count == 0) return cel;
byte[][] ta = new byte[count][];
ta = top.toArray(ta);
synchronized (this) { synchronized (this) {
for (byte[] n: top) { for (byte[] n: ta) {
try { try {
final Row.Entry rowEntry = urlFileIndex.get(n); final Row.Entry rowEntry = urlFileIndex.get(n);
if (rowEntry == null) continue; if (rowEntry == null) continue;

Loading…
Cancel
Save