- 2 small changes in documentation

- hopefully fixed logging of GCs (in order to avoid things like "performed necessary GC, freed 18014398509481565 KB (requested/available/average: 4096 / 1631 / 2957 KB)") with the help of KoH


git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@3909 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
michitux 18 years ago
parent c59a7ce5c2
commit 25529290ca

@ -1,5 +1,5 @@
function Progressbar(length, parent) {
// the description, should be translated
// the description (displayed above the progressbar while loading the results), should be translated
var DESCRIPTION_STRING = "Loading results...";
// the number of steps of the bar

@ -115,7 +115,7 @@ public class serverMemory {
* <p><em>Be careful with this method as GCs should always be the last measure to take</em></p>
*
* @param size the requested amount of free memory in bytes
* @param specifies whether a GC should be run even in case former GCs didn't provide enough memory
* @param force specifies whether a GC should be run even in case former GCs didn't provide enough memory
* @return whether enough memory could be freed (or is free) or not
*/
public static boolean request(final long size, final boolean force) {
@ -123,20 +123,20 @@ public class serverMemory {
if (avail >= size) return true;
if (log.isFine()) {
String t = new Throwable("Stack trace").getStackTrace()[1].toString();
log.logFine(t + " requested " + (size >>> 10) + " KB, got " + (avail >>> 10) + " KB");
log.logFine(t + " requested " + (size >> 10) + " KB, got " + (avail >> 10) + " KB");
}
final long avg = getAverageGCFree();
if (force || avg == 0 || avg + avail >= size) {
// this is only called if we expect that an allocation of <size> bytes would cause the jvm to call the GC anyway
final long freed = runGC(!force);
avail = available();
log.logInfo("performed " + ((force) ? "explicit" : "necessary") + " GC, freed " + (freed >>> 10)
+ " KB (requested/available/average: " + (size >>> 10) + " / "
+ (avail >>> 10) + " / " + (avg >>> 10) + " KB)");
log.logInfo("performed " + ((force) ? "explicit" : "necessary") + " GC, freed " + (freed >> 10)
+ " KB (requested/available/average: " + (size >> 10) + " / "
+ (avail >> 10) + " / " + (avg >> 10) + " KB)");
return avail >= size;
} else {
log.logInfo("former GCs indicate to not be able to free enough memory (requested/available/average: "
+ (size >>> 10) + " / " + (avail >>> 10) + " / " + (avg >>> 10) + " KB)");
+ (size >> 10) + " / " + (avail >> 10) + " / " + (avg >> 10) + " KB)");
return false;
}
}

Loading…
Cancel
Save