Skip to content

Commit

Permalink
Include erts_mmap in snapshot to help debug VM issues
Browse files Browse the repository at this point in the history
  • Loading branch information
garazdawi committed Aug 30, 2023
1 parent 9efec26 commit 59c59ba
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/recon_alloc.erl
Original file line number Diff line number Diff line change
Expand Up @@ -369,11 +369,13 @@ sbcs_to_mbcs(Keyword) ->
allocators() ->
UtilAllocators = erlang:system_info(alloc_util_allocators),
Allocators = [sys_alloc,mseg_alloc|UtilAllocators],
[{{A,N}, format_alloc(A, Props)} ||
A <- Allocators,
Allocs <- [erlang:system_info({allocator,A})],
Allocs =/= false,
{_,N,Props} <- Allocs].
try [{{erts_mmap,0},erlang:system_info({allocator,erts_mmap})}]
catch error:badarg -> [] end ++
[{{A,N}, format_alloc(A, Props)} ||
A <- Allocators,
Allocs <- [erlang:system_info({allocator,A})],
Allocs =/= false,
{_,N,Props} <- Allocs].

format_alloc(Alloc, Props) ->
%% {versions,_,_} is implicitly deleted in order to allow the use of the
Expand Down Expand Up @@ -638,6 +640,8 @@ conv_mem(Mem,Factor) ->

conv_alloc([{{sys_alloc,_I},_Props} = Alloc|R], Factor) ->
[Alloc|conv_alloc(R,Factor)];
conv_alloc([{{erts_mmap,_I},_Props} = Alloc|R], Factor) ->
[Alloc|conv_alloc(R,Factor)];
conv_alloc([{{mseg_alloc,_I} = AI,Props}|R], Factor) ->
MemKind = orddict:fetch(memkind,Props),
Status = orddict:fetch(status,MemKind),
Expand Down

0 comments on commit 59c59ba

Please sign in to comment.