Small corrections to dhtFlushControl()

- Test wCacheMaxChunk against maxURLinCache(), not getMaxWordCount(). This triggered a flush everytime dhtFlushControl() was called.
- If triggered, flush at least 1 entry.


git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@4187 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
hermens 18 years ago
parent 55c87b3b12
commit 8f9d65da67

@ -155,10 +155,11 @@ public final class plasmaWordIndex implements indexRI {
public void dhtFlushControl(indexRAMRI theCache) {
// check for forced flush
synchronized (theCache) {
if ((theCache.getMaxWordCount() > wCacheMaxChunk ) ||
if ((theCache.maxURLinCache() > wCacheMaxChunk ) ||
(theCache.size() > theCache.getMaxWordCount()) ||
(serverMemory.available() < collections.minMem())) {
flushCache(theCache, theCache.size() + flushsize - theCache.getMaxWordCount());
int count = theCache.size() + flushsize - theCache.getMaxWordCount();
flushCache(theCache, (count > 0) ? count : 1);
}
}
}

Loading…
Cancel
Save