Skip to content

Commit bcf747f

Browse files
committed
Add code comments about async purging
1 parent 1acb267 commit bcf747f

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

lib/elixir/src/elixir_code_server.erl

+5
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,11 @@ handle_cast(purge_compiler_modules, Config) ->
102102
case Used of
103103
[] -> ok;
104104
_ ->
105+
%% Purging modules became more expensive in Erlang/OTP 27+,
106+
%% so we accumulate them all during compilation and then
107+
%% purge them asynchronously, especially because they can
108+
%% block the code server. Ideally we would purge them in
109+
%% batches, but that's not supported at the moment.
105110
Opts = [{monitor, [{tag, {purged, Used}}]}],
106111
erlang:spawn_opt(fun() ->
107112
[code:purge(Module) || Module <- Used],

0 commit comments

Comments
 (0)