Changeset 394
- Timestamp:
- 08/04/10 20:11:03 (2 years ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
kahina/trunk/src/org/kahina/core/io/magazine/ObjectMagazine.java
r393 r394 34 34 { 35 35 private static final boolean VERBOSE = true; 36 37 private static final int MIN_BLOCKS = 10; // TODO make configurable 36 38 37 39 private final File folder; … … 39 41 private final int blockSize; 40 42 41 private final float lowerBound; 43 private final float lowerBound; // TODO use or abolish 42 44 43 45 private final float upperBound; … … 132 134 ns = System.nanoTime(); 133 135 } 134 // TODO Comparing memory usage to the lower bound doesn't really 135 // make sense, the VM will keep all the garbage lying around. Maybe 136 // just reduce to a fixed number of blocks (like 10) and explicitly 137 // garbage-collect then. 138 while (blockNumbersUnloadQueue.size() > 1 && memoryRatio() > lowerBound) 136 while (blockNumbersUnloadQueue.size() > MIN_BLOCKS) 139 137 { 140 138 unloadBlock(blockNumbersUnloadQueue.removeFirst()); 141 139 } 140 System.gc(); 142 141 if (VERBOSE) 143 142 {
