[erlang-questions] mnesia memory leak?

Dale Harvey <>
Sat May 30 01:15:56 CEST 2009


Did this patch make it into R13?

I am observing similiar behaviour, I have tried
adding the allow_garb() start_garb() but still seeing
ets continously grow without releasing memory,

Checking ets:i() I can see there are various
mnesia_transient_decision table created that
grow permanently.

The memory growth seems identical even if I
run the tests inside a spawned process that
dies

1> test:test().
erlang 176316
erlang 824852
ok
2> test:run().
erlang 824852
erlang 1472756
ok
3> test:run().
erlang 1472756
erlang 2120644
4> spawn( fun() -> test:run() end).
erlang 2120644
<0.30083.0>
erlang 2768540

-module(test).
-compile(export_all).

test() ->
    application:stop(mnesia),
    ok = mnesia:delete_schema([node()]),
    ok = mnesia:create_schema([node()]),
    application:start(mnesia),
    mnesia:create_table(test, [{type, bag}, {attributes, [id, field1]}]),

    run(),

    ok.

info() ->
    io:format("ets memory ~p~n", [erlang:memory(ets)]).

run() ->
    info(),
    [ read() || _X <- lists:seq(1, 10000)],
    mnesia_recover:allow_garb(),
    mnesia_recover:start_garb(),
    info().

read() ->
    mnesia:activity(transaction, fun mnesia:first/1, [test]).



2008/7/10 andrey-google <>

> That's very good news.
> Thanks a lot to Mog and Dan.
>
> dvader
>
> _______________________________________________
> erlang-questions mailing list
> 
> http://www.erlang.org/mailman/listinfo/erlang-questions
>


More information about the erlang-questions mailing list