Changeset 395
- Timestamp:
- 08/04/10 22:01:29 (2 years ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
kahina/trunk/src/org/kahina/core/io/magazine/ObjectMagazine.java
r394 r395 35 35 private static final boolean VERBOSE = true; 36 36 37 private static final int MIN_BLOCKS = 1 0; // TODO make configurable37 private static final int MIN_BLOCKS = 1; 38 38 39 39 private final File folder; … … 41 41 private final int blockSize; 42 42 43 private final float lowerBound; // TODO use or abolish43 private final float lowerBound; 44 44 45 45 private final float upperBound; … … 134 134 ns = System.nanoTime(); 135 135 } 136 while (blockNumbersUnloadQueue.size() > MIN_BLOCKS) 136 // TODO Comparing memory usage to the lower bound doesn't really 137 // make sense, the VM will keep all the garbage lying around. Maybe 138 // just reduce to a fixed number of blocks (like 10) and explicitly 139 // garbage-collect then. 140 while (blockNumbersUnloadQueue.size() > MIN_BLOCKS && memoryRatio() > lowerBound) 137 141 { 138 142 unloadBlock(blockNumbersUnloadQueue.removeFirst()); 139 143 } 140 System.gc();141 144 if (VERBOSE) 142 145 { … … 196 199 public static <S> ObjectMagazine<S> create() 197 200 { 198 return create(1000, 0.2F, 0. 6F);201 return create(1000, 0.2F, 0.9F); 199 202 } 200 203
