fogfish/cache

Set a limit on the use memory

Kozlov-V opened this issue · 1 comments

How can I set a limit on the use of memory, when i use this project in my App ?
I try start on VPS:
{ok, _} = cache:start_link(my_cache, [{memory, 1000000}, {n, 10}, {ttl, 60}]).
and I get this error:

** exception exit: undef
     in function  erlang:sysinfo/1
        called as erlang:sysinfo(wordsize)
     in call from cache_bucket:init/2 (src/cache_bucket.erl, line 79)
     in call from cache_bucket:init/1 (src/cache_bucket.erl, line 73)
     in call from gen_server:init_it/6 (gen_server.erl, line 304)
     in call from proc_lib:init_p_do_apply/3 (proc_lib.erl, line 239)

When I add in sys.config i have error too, when start up my App(
And i try add into {env, [{memory, 206870912}]} in myapp.app.src, but it did not produce the expected effect it to limit memory

Hmm, good point... thanks for reporting.
It is fixed in 0.9.1 version (commit b3382c7)