Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save arcusfelis/104227e5fe0f1b5792c0799e1b64fafa to your computer and use it in GitHub Desktop.
Save arcusfelis/104227e5fe0f1b5792c0799e1b64fafa to your computer and use it in GitHub Desktop.
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)])).
@arcusfelis
Copy link
Author

arcusfelis commented Apr 5, 2022

[rpc:call(Node, erlang, apply, [fun() -> lists:map(fun erlang:garbage_collect/1, erlang:processes()) end]) || Node <- nodes()].

@arcusfelis
Copy link
Author

arcusfelis commented Apr 5, 2022

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