diff options
author | John Högberg <[email protected]> | 2019-08-08 10:06:25 +0200 |
---|---|---|
committer | John Högberg <[email protected]> | 2019-08-09 14:29:39 +0200 |
commit | 9f73f98ad6ddf70d30dfc0a1daf7c992dcc5061a (patch) | |
tree | db0771bf4e7e323b4b18d4a3c4b1d5d71ec960a5 /lib/observer/test | |
parent | 83cd52cf585e37f65f956f18464b8cec98dde469 (diff) | |
download | otp-9f73f98ad6ddf70d30dfc0a1daf7c992dcc5061a.tar.gz otp-9f73f98ad6ddf70d30dfc0a1daf7c992dcc5061a.tar.bz2 otp-9f73f98ad6ddf70d30dfc0a1daf7c992dcc5061a.zip |
erts: Create heap binaries in bs_get_binary2
ErlSubBin is a large struct that often dwarfs the region of memory
it points at, and it's common for them to refer to a ProcBin which
must be kept around as long as the SubBin lives, using up even more
heap space and keeping the referenced binary alive regardless of
how small the sub-binary is.
Diffstat (limited to 'lib/observer/test')
-rw-r--r-- | lib/observer/test/crashdump_helper.erl | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/observer/test/crashdump_helper.erl b/lib/observer/test/crashdump_helper.erl index 84ed99afa5..10d88c994a 100644 --- a/lib/observer/test/crashdump_helper.erl +++ b/lib/observer/test/crashdump_helper.erl @@ -48,7 +48,7 @@ n1_proc(Creator,_N2,Pid2,Port2,_L) -> Ref = make_ref(), Pid = self(), Bin = list_to_binary(lists:seq(1, 255)), - <<_:2,SubBin:17/binary,_/bits>> = Bin, + <<_:2,SubBin:65/binary,_/bits>> = Bin, register(named_port,Port), @@ -102,7 +102,7 @@ remote_proc(P1,Creator) -> end). create_binaries() -> - Sizes = lists:seq(60, 70) ++ lists:seq(120, 140), + Sizes = lists:seq(100, 120) ++ lists:seq(200, 240), [begin <<H:16/unit:8>> = erlang:md5(<<Size:32>>), Data = ((H bsl (8*150)) div (H+7919)), @@ -113,7 +113,7 @@ create_sub_binaries(Bins) -> [create_sub_binary(Bin, Start, LenSub) || Bin <- Bins, Start <- [0,1,2,3,4,5,10,22], - LenSub <- [0,1,2,3,4,6,9]]. + LenSub <- [0,1,2,3,4,6,9,65]]. create_sub_binary(Bin, Start, LenSub) -> Len = byte_size(Bin) - LenSub - Start, |