From ff772a50d2be3770a480ccf6348935a5e389c626 Mon Sep 17 00:00:00 2001 From: Hans Bolinder Date: Tue, 16 Jan 2018 15:14:45 +0100 Subject: stdlib: Garbage the shell's evaluator process more often A minor fix. If the Erlang shell saves no results (history(0) or results(0)), the evaluator process now garbage collects itself. This means that any huge binaries created by the evaluation are reclaimed faster than before. --- lib/stdlib/src/shell.erl | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/stdlib/src/shell.erl b/lib/stdlib/src/shell.erl index 212b143b1d..ad4984b64c 100644 --- a/lib/stdlib/src/shell.erl +++ b/lib/stdlib/src/shell.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1996-2017. All Rights Reserved. +%% Copyright Ericsson AB 1996-2018. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. @@ -701,7 +701,9 @@ exprs([E0|Es], Bs1, RT, Lf, Ef, Bs0, W) -> {W,V0}; true -> case result_will_be_saved() of true -> V0; - false -> ignored + false -> + erlang:garbage_collect(), + ignored end end, {{value,V,Bs,get()},Bs}; -- cgit v1.2.3