Permalink
Browse files

Restrict CACHE_SIZE to no more than 30% of the max memory.

Higher values cause a OOM to be thrown.
  • Loading branch information...
1 parent 3e95b48 commit b07c02dbf572b38afc4fc794ba8e60f52b782f43 @ijuma ijuma committed Jun 18, 2009
Showing with 1 addition and 3 deletions.
  1. +1 −3 test/unit/voldemort/store/bdb/BdbSplitStorageEngineTest.java
@@ -46,7 +46,7 @@
private File bdbMasterDir;
private BdbStorageConfiguration bdbStorage;
- private static long CACHE_SIZE = (long) Math.min(Runtime.getRuntime().maxMemory() * 0.95,
+ private static long CACHE_SIZE = (long) Math.min(Runtime.getRuntime().maxMemory() * 0.30,
500 * 1000 * 1000);
@Override
@@ -139,8 +139,6 @@ public void testUnsharedCache() throws DatabaseException {
environmentConfig.setAllowCreate(true);
environmentConfig.setTransactional(true);
environmentConfig.setSharedCache(false);
-
- // set cache size to 95 % of max memory available
environmentConfig.setCacheSize(CACHE_SIZE);
DatabaseConfig databaseConfig = new DatabaseConfig();

0 comments on commit b07c02d

Please sign in to comment.