phoenixframework / phoenix_live_dashboard

Realtime dashboard with metrics, request logging, plus storage, OS and VM insights
MIT License
2.02k stars 184 forks source link

Add Memory Allocators tab #403

Closed josevalim closed 1 year ago

josevalim commented 1 year ago

We have this page on Observer and I think it can be really useful for tracking memory growth in projects:

image

I am also trying to move the instrument.erl module to runtime_tools in Erlang/OTP 26.0. It is basically a tool for generating histograms of memory allocation.

The code for getting allocator information is easy:

alloc_info() ->
    AlcuAllocs = erlang:system_info(alloc_util_allocators),
    try erlang:system_info({allocator_sizes, AlcuAllocs}) of
    Allocators -> Allocators
    catch _:_ -> []
    end.