Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

reduce lmdb mem map size from 1 TB to 128 MB for MNIST data #3644

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions examples/mnist/convert_mnist_data.cpp
Expand Up @@ -77,7 +77,7 @@ void convert_dataset(const char* image_filename, const char* label_filename,
leveldb::Options options;
options.error_if_exists = true;
options.create_if_missing = true;
options.write_buffer_size = 268435456;
options.write_buffer_size = 128*1024*1024;
leveldb::WriteBatch* batch = NULL;

// Open db
Expand All @@ -93,7 +93,7 @@ void convert_dataset(const char* image_filename, const char* label_filename,
CHECK_EQ(mkdir(db_path, 0744), 0)
<< "mkdir " << db_path << "failed";
CHECK_EQ(mdb_env_create(&mdb_env), MDB_SUCCESS) << "mdb_env_create failed";
CHECK_EQ(mdb_env_set_mapsize(mdb_env, 1099511627776), MDB_SUCCESS) // 1TB
CHECK_EQ(mdb_env_set_mapsize(mdb_env, 128*1024*1024), MDB_SUCCESS)
<< "mdb_env_set_mapsize failed";
CHECK_EQ(mdb_env_open(mdb_env, db_path, 0, 0664), MDB_SUCCESS)
<< "mdb_env_open failed";
Expand Down