emergency disabling of GenerationMemoryStrategy because of non-working

available-method
pull/1/head
Michael Peter Christen 13 years ago
parent 411aab02e3
commit 0d6176804b

@ -645,7 +645,7 @@ public class HeapReader {
if (this.index != null) this.index.close();
this.index = null;
this.closeDate = new Date();
Log.logInfo("HeapReader", "close HeapFile " + this.heapFile.getName() + "; trace:" + Log.stackTrace());
Log.logInfo("HeapReader", "close HeapFile " + this.heapFile.getName() + "; trace: " + Log.stackTrace());
}
}

@ -32,7 +32,7 @@ public class MemoryControl {
private static boolean shortStatus = false, simulatedShortStatus = false, usingStandardStrategy = true;
private static MemoryStrategy strategy;
private static MemoryStrategy getStrategy() {
if (strategy == null || strategy.hasError()) {
if (!usingStandardStrategy) {
@ -48,14 +48,16 @@ public class MemoryControl {
}
return strategy;
}
public final static void setStandardStrategy(final boolean std) {
/*
if (usingStandardStrategy != std) {
usingStandardStrategy = std;
strategy = null;
}
*/
}
/**
* @return the name of the used strategy
*/
@ -108,12 +110,13 @@ public class MemoryControl {
/**
* check for a specified amount of bytes
*
*
* @param size the requested amount of free memory in bytes
* @param force specifies whether risk an expensive GC
* @return whether enough memory could be freed (or is free) or not
*/
public static boolean request(final long size, final boolean force) {
if (size < 1024) return true; // to speed up things. If this would fail, it would be much too late to check this.
return getStrategy().request(size, force, shortStatus);
}
@ -187,7 +190,7 @@ public class MemoryControl {
System.out.println("computed max = " + (maxMemory() / mb) + " mb");
System.out.println("using " + getStrategyName());
final byte[][] x = new byte[100000][];
for (int i = 0; i < 100000; i++) {
if (request(mb, force))
{

Loading…
Cancel
Save