Created
April 5, 2022 04:23
-
-
Save arcusfelis/104227e5fe0f1b5792c0799e1b64fafa to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rp(lists:reverse([{Len, case erlang:process_info(TopPid, registered_name) of {_,X} -> X; _ -> TopPid end, erlang:process_info(TopPid, current_stacktrace)} || {Len, TopPid} <- lists:sublist(lists:reverse(lists:keysort(1, [{try element(2,erlang:process_info(Pid, memory)) catch _:_ -> -1 end, Pid} || Pid <- erlang:processes()])), 20)])). |
G = fun(N) -> lists:map(fun erlang:garbage_collect/1, erlang:processes()), timer:sleep(60000), N(N) end.
[rpc:call(Node, erlang, spawn, [fun() -> erlang:register(force_gc, self()), G(G) end]) || Node <- [node()|nodes()]].
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
[rpc:call(Node, erlang, apply, [fun() -> lists:map(fun erlang:garbage_collect/1, erlang:processes()) end]) || Node <- nodes()].