diff options
author | Rickard Green <rickard@erlang.org> | 2015-02-13 00:25:57 +0100 |
---|---|---|
committer | Rickard Green <rickard@erlang.org> | 2015-03-20 15:28:52 +0100 |
commit | 6b1921d767de5cd1a980234f83b36dbfa13d9fc7 (patch) | |
tree | 0b7a016c2b41f30f1adf81559e5fc6a4567099ea /erts/emulator/test/timer_bif_SUITE.erl | |
parent | fa7b2c00cbf9212c4a3551980939b92fc6606510 (diff) | |
download | otp-6b1921d767de5cd1a980234f83b36dbfa13d9fc7.tar.gz otp-6b1921d767de5cd1a980234f83b36dbfa13d9fc7.tar.bz2 otp-6b1921d767de5cd1a980234f83b36dbfa13d9fc7.zip |
Erlang based BIF timer implementation for scalability
Diffstat (limited to 'erts/emulator/test/timer_bif_SUITE.erl')
-rw-r--r-- | erts/emulator/test/timer_bif_SUITE.erl | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/erts/emulator/test/timer_bif_SUITE.erl b/erts/emulator/test/timer_bif_SUITE.erl index c28224729d..da19be3424 100644 --- a/erts/emulator/test/timer_bif_SUITE.erl +++ b/erts/emulator/test/timer_bif_SUITE.erl @@ -238,6 +238,7 @@ cleanup(Config) when is_list(Config) -> ?line wait_until(fun () -> process_is_cleaned_up(P1) end), ?line T1 = erlang:start_timer(10000, P1, "hej"), ?line T2 = erlang:send_after(10000, P1, "hej"), + receive after 1000 -> ok end, ?line Mem = mem(), ?line false = erlang:read_timer(T1), ?line false = erlang:read_timer(T2), @@ -250,6 +251,7 @@ cleanup(Config) when is_list(Config) -> ?line true = is_integer(erlang:read_timer(T3)), ?line true = is_integer(erlang:read_timer(T4)), ?line wait_until(fun () -> process_is_cleaned_up(P2) end), + receive after 1000 -> ok end, ?line false = erlang:read_timer(T3), ?line false = erlang:read_timer(T4), ?line Mem = mem(), @@ -455,10 +457,18 @@ registered_process(Config) when is_list(Config) -> ?line ok. mem() -> - AA = erlang:system_info(allocated_areas), - {value,{bif_timer,Mem}} = lists:keysearch(bif_timer, 1, AA), - Mem. - + TSrvs = erts_internal:get_bif_timer_servers(), + lists:foldl(fun (Tab, Sz) -> + case lists:member(ets:info(Tab, owner), TSrvs) of + true -> + ets:info(Tab, memory) + Sz; + false -> + Sz + end + end, + 0, + ets:all())*erlang:system_info({wordsize,external}). + process_is_cleaned_up(P) when is_pid(P) -> undefined == erts_debug:get_internal_state({process_status, P}). |