[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: (ITS#7651) LMDB: Uncontrolled database when opened from multiple processes

Hi again,

I was able to recreate the scenario in a test case. I must have mixed 
something up previously. After more tests it seems that the memory 
growth only appears when transactions are reset within the child.

Here's the full code:

Output on my machine:

$ rm -f testdb/* && mkdir -p testdb && make mtest8 && ./mtest8
gcc -pthread -O2 -g -W -Wall -Wno-unused-parameter -Wbad-function-cast   
-c mtest8.c
gcc -pthread -O2 -g -W -Wall -Wno-unused-parameter -Wbad-function-cast   
mtest8.o liblmdb.a  -o mtest8
NO FORK     : 1699840
FORK & OPEN : 1699840
FORK & COPY : 6225920


On 30/07/13 23:34, Hallvard Breien Furuseth wrote:
> Whoops, too hasty reply.  Didn't notice your mdb_env_close(env)
> before the fork.  But do you mdb_env_create() again after?
> mdb_env_close() destroys the MDB_env.