diff options
Diffstat (limited to 'common/storage_lmdb.cpp')
-rw-r--r-- | common/storage_lmdb.cpp | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/common/storage_lmdb.cpp b/common/storage_lmdb.cpp index 79f4465..91d2443 100644 --- a/common/storage_lmdb.cpp +++ b/common/storage_lmdb.cpp | |||
@@ -30,6 +30,7 @@ | |||
30 | #include <QString> | 30 | #include <QString> |
31 | #include <QTime> | 31 | #include <QTime> |
32 | #include <QMutex> | 32 | #include <QMutex> |
33 | #include <valgrind.h> | ||
33 | 34 | ||
34 | #include <lmdb.h> | 35 | #include <lmdb.h> |
35 | #include "log.h" | 36 | #include "log.h" |
@@ -621,11 +622,16 @@ Storage::Private::Private(const QString &s, const QString &n, AccessMode m) : st | |||
621 | mdb_env_close(env); | 622 | mdb_env_close(env); |
622 | env = 0; | 623 | env = 0; |
623 | } else { | 624 | } else { |
624 | // FIXME: dynamic resize | 625 | if (RUNNING_ON_VALGRIND) { |
625 | // In order to run valgrind this size must be smaller than half your available RAM | 626 | // In order to run valgrind this size must be smaller than half your available RAM |
626 | // https://github.com/BVLC/caffe/issues/2404 | 627 | // https://github.com/BVLC/caffe/issues/2404 |
627 | const size_t dbSize = (size_t)10485760 * (size_t)8000; // 1MB * 8000 | 628 | const size_t dbSize = (size_t)10485760 * (size_t)1000; // 1MB * 1000 |
628 | mdb_env_set_mapsize(env, dbSize); | 629 | mdb_env_set_mapsize(env, dbSize); |
630 | } else { | ||
631 | // FIXME: dynamic resize | ||
632 | const size_t dbSize = (size_t)10485760 * (size_t)8000; // 1MB * 8000 | ||
633 | mdb_env_set_mapsize(env, dbSize); | ||
634 | } | ||
629 | sEnvironments.insert(fullPath, env); | 635 | sEnvironments.insert(fullPath, env); |
630 | } | 636 | } |
631 | } | 637 | } |