diff options
author | Hans Bolinder <[email protected]> | 2018-01-16 15:14:45 +0100 |
---|---|---|
committer | Hans Bolinder <[email protected]> | 2018-01-16 15:24:50 +0100 |
commit | ff772a50d2be3770a480ccf6348935a5e389c626 (patch) | |
tree | 06c866b990b41e65d6078683761a67528ae3c542 /lib | |
parent | a5a0d49a3e9e76ed893920698f7ddbd97601d671 (diff) | |
download | otp-ff772a50d2be3770a480ccf6348935a5e389c626.tar.gz otp-ff772a50d2be3770a480ccf6348935a5e389c626.tar.bz2 otp-ff772a50d2be3770a480ccf6348935a5e389c626.zip |
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.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/stdlib/src/shell.erl | 6 |
1 files 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}; |