```elixir test "memory" do TokenBalance.Supervisor.Case.start_supervised!(json_rpc_named_arguments: []) pid = Process.whereis(TokenBalance.Fetcher) 10_000 |> insert_list(:token_balance) |> TokenBalance.Fetcher.async_fetch() Process.info(pid, :memory) |> IO.inspect(label: "BEFORE GC") :erlang.garbage_collect(pid) Process.info(pid, :memory) |> IO.inspect(label: "AFTER GC") end ``` | Token Balances | Garbage Collection | `%TokenBalance{}`s (bytes) | `%{token_contract_address_hash: Hash.to_string(token_contract_address_hash), address_hash: Hash.to_string(address_hash), block_number: block_number}` (bytes) | Map / Struct (%) | |----------------|--------------------|----------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------| | 1,000 | Before | 2,549,476 | 233,500 | 9.16 | | 1,000 | After | 2,546,468 | 233,500 | 9.17 | | 10,000 | Before | 19,903,172 | 2,549,476 | 12.81 | | 10,000 | After | 19,900,260 | 2,546,468 | 12.80 |pull/917/head
parent
753319de4a
commit
48b1de4617
Loading…
Reference in new issue