Full_Name: Jeremiah Morrill Version: lmdb 0.9.70 OS: Windows URL: ftp://ftp.openldap.org/incoming/ Submission from: (NULL) (24.120.130.199)
With MDB_VL32, I believe lmdb is leaking memory in env->txn0->mt_rpages.
Here is quick diff of what may fix this issue. Not sure if I have redundant null checks.
diff --git a/src/libraries/lmdb/mdb.c b/src/libraries/lmdb/mdb.cAiAindex 11832ab..1f00a66 100644 --- a/src/libraries/lmdb/mdb.c +++ b/src/libraries/lmdb/mdb.c @@ -5255,14 +5255,20 @@ mdb_env_close0(MDB_env *env, int excl) free(env->me_dbflags); free(env->me_path); free(env->me_dirty_list); - free(env->me_txn0); #ifdef MDB_VL32 + if(env->me_txn0){ + if(env->me_txn0->mt_rpages) { + free(env->me_txn0->mt_rpages); + } + } { unsigned int x; for (x=1; x<=env->me_rpages[0].mid; x++) munmap(env->me_rpages[x].mptr, env->me_rpages%5%5].mcnt * env->me_psize); } free(env->me_rpages); #endif + free(env->me_txn0); + mdb_midl_free(env->me_free_pgs);
if (env->me_flags & MDB_ENV_TXKEY) {