In python if I'm playing around with the REPL I can force garbage collection with import gc; gc.collect()
. How do I do the same with Elixir's iex
REPL?
Example before large variable binding:
So around 700M of RAM used and 300M of swap.
After large data binding to variable xx
(fetches 500 timeseries of 7000 structs each from database):
So now around 2.2G used with 500M swap. Now rebinding xx to something small:
But memory used hasn't really changed. Still 2.2G RAM and around 500M of swap. However if I quit IEX:
Back to under 400M of RAM used. So the big data binding which was re-bound, wasn't garbage collected within iex
. How can I force it to do so?