archaelus/eshellcode — pull request #1 by 0ctave (2013-12-16 19:58:02+00:00)
Title: add top_procs_running.erl

Shows which kinds of processes are running in the system (grouping by initial_call MFA).
Useful for analyzing process leaks.

Example:

```erlang
1> TopProcsRunning().
[{{proc_lib,init_p,5},12},
{{erlang,apply,2},8},
{{group,server,3},2},
{{application_master,start_it,4},1},
{{user_drv,server,2},1},
{{otp_ring0,start,2},1}]
```

Example 2:

```erlang
2> ProcsGroupBy(current_function).
[{{gen_server,loop,6},11},
{{group,server_loop,3},2},
{{application_master,loop_it,4},1},
{{user_drv,server_loop,5},1},
{{standard_error,server_loop,1},1},
{{code_server,loop,1},1},
{{global,loop_the_locker,1},1},
{{gen_event,fetch_msg,5},1},
{{erl_prim_loader,loop,3},1},
{{erl_eval,do_apply,6},1},
{{init,loop,1},1},
{{global,loop_the_registrar,0},1},
{{shell,shell_rep,4},1},
{{application_master,main_loop,2},1}]
```