Browse files

Don't allow CACHE_SIZE to exceed the maximum memory available.

  • Loading branch information...
1 parent 6fd4a47 commit 3e95b48ac920b0baaa70f562460c33da693a7894 @ijuma ijuma committed Jun 18, 2009
Showing with 2 additions and 2 deletions.
  1. +2 −2 test/unit/voldemort/store/bdb/BdbSplitStorageEngineTest.java
View
4 test/unit/voldemort/store/bdb/BdbSplitStorageEngineTest.java
@@ -46,8 +46,8 @@
private File bdbMasterDir;
private BdbStorageConfiguration bdbStorage;
- // Berkeley DB keeps growing cache till 500MB
- private static long CACHE_SIZE = 500 * 1000 * 1000;
+ private static long CACHE_SIZE = (long) Math.min(Runtime.getRuntime().maxMemory() * 0.95,
+ 500 * 1000 * 1000);
@Override
protected void setUp() throws Exception {

0 comments on commit 3e95b48

Please sign in to comment.