summaryrefslogtreecommitdiffstats
path: root/common/storage_lmdb.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'common/storage_lmdb.cpp')
-rw-r--r--common/storage_lmdb.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/common/storage_lmdb.cpp b/common/storage_lmdb.cpp
index a8c5cc7..ddb4f84 100644
--- a/common/storage_lmdb.cpp
+++ b/common/storage_lmdb.cpp
@@ -838,6 +838,14 @@ public:
838 } else { 838 } else {
839 //Limit large enough to accomodate all our named dbs. This only starts to matter if the number gets large, otherwise it's just a bunch of extra entries in the main table. 839 //Limit large enough to accomodate all our named dbs. This only starts to matter if the number gets large, otherwise it's just a bunch of extra entries in the main table.
840 mdb_env_set_maxdbs(env, 50); 840 mdb_env_set_maxdbs(env, 50);
841 if (RUNNING_ON_VALGRIND) {
842 // In order to run valgrind this size must be smaller than half your available RAM
843 // https://github.com/BVLC/caffe/issues/2404
844 mdb_env_set_mapsize(env, (size_t)10485760 * (size_t)1000); // 1MB * 1000
845 } else {
846 //This is the maximum size of the db (but will not be used directly), so we make it large enough that we hopefully never run into the limit.
847 mdb_env_set_mapsize(env, (size_t)10485760 * (size_t)100000); // 1MB * 1000
848 }
841 const bool readOnly = (mode == ReadOnly); 849 const bool readOnly = (mode == ReadOnly);
842 unsigned int flags = MDB_NOTLS; 850 unsigned int flags = MDB_NOTLS;
843 if (readOnly) { 851 if (readOnly) {
@@ -852,14 +860,6 @@ public:
852 mdb_env_close(env); 860 mdb_env_close(env);
853 env = 0; 861 env = 0;
854 } else { 862 } else {
855 if (RUNNING_ON_VALGRIND) {
856 // In order to run valgrind this size must be smaller than half your available RAM
857 // https://github.com/BVLC/caffe/issues/2404
858 mdb_env_set_mapsize(env, (size_t)10485760 * (size_t)1000); // 1MB * 1000
859 } else {
860 //This is the maximum size of the db (but will not be used directly), so we make it large enough that we hopefully never run into the limit.
861 mdb_env_set_mapsize(env, (size_t)10485760 * (size_t)100000); // 1MB * 1000
862 }
863 Q_ASSERT(env); 863 Q_ASSERT(env);
864 sEnvironments.insert(fullPath, env); 864 sEnvironments.insert(fullPath, env);
865 //Open all available dbi's 865 //Open all available dbi's