Closed kgl-prml closed 8 years ago
It looks like this is related to my pull request: https://github.com/BVLC/caffe/pull/3731
Can you edit your post to add ```cpp for preformatting? It's hard to tell what you edited.
// like this
int main() {}
OK. Sorry for that. My modifications are as follows: (From line 82 in src/caffe/util/db_lmdb.cpp
). And I have created a pull request #4115.
int commit_rc = 0;
if (!out_of_memory) {
// Commit the transaction
commit_rc = mdb_txn_commit(mdb_txn);
//MDB_CHECK(commit_rc);
if(commit_rc == MDB_MAP_FULL){
out_of_memory = true;
} else {
MDB_CHECK(commit_rc);
mdb_dbi_close(mdb_env_, mdb_dbi);
keys.clear();
values.clear();
}
}
if(out_of_memory){
// Double the map size and retry
if(commit_rc != MDB_MAP_FULL){
mdb_txn_abort(mdb_txn);
}
mdb_dbi_close(mdb_env_, mdb_dbi);
DoubleMapSize();
Commit();
}
Thanks for the bug report @kgl-prml. I had never encountered a MDB_MAP_FULL
error coming from mdb_txn_commit()
. Can you try this branch and see if it solves your problem? If so, I'll create a pull request to get it added to master
.
https://github.com/BVLC/caffe/compare/master...lukeyeager:bvlc/fix-lmdb-pr
And I have created a pull request #4115.
Oh sorry, I hadn't seen that yet.
I wrote a program to transfer my
csv
file tolmdb
format usingdb:DB
anddb::Transaction
defined indb.hpp
anddb_lmdb.hpp
. And I encountered a strange error. I doubt if there exists a bug in thedb:Transaction
definition. convert_csv_data.cpp.txtIn
db_lmdb.cpp
line 72:int put_rc = mdb_put(mdb_txn, mdb_dbi, &mdb_key, &mdb_data, 0);
And line 84:
MDB_CHECK(mdb_txn_commit(mdb_txn));
My result shows that
mdb_put
succeed (i.e.put_rc = 0
) andmdb_txn_commit
failed and throws aMDB_MAP_FULL
error. (i.e. error code is -30792). So in thevoid LMDBTransaction::Commit()
, it thinks the map size is enough (i.e.put_rc=0
), howevermdb_txn_commit
failed because ofMDB_MAP_FULL
. Furthermore, the current LMDB map size is 2M only.Part of the log information is listed as follows:
The convert_csv_data.cpp wrote by myself is in the attachment.