aboutsummaryrefslogtreecommitdiffstats
path: root/lib/dialyzer/src/dialyzer_analysis_callgraph.erl
diff options
context:
space:
mode:
authorHans Bolinder <[email protected]>2016-12-09 16:16:11 +0100
committerHans Bolinder <[email protected]>2017-01-11 09:34:59 +0100
commit7a6ea7e9946e72a03167145c476e66ee77098b6e (patch)
tree173a4689b82de0835073929c414a026cf029de52 /lib/dialyzer/src/dialyzer_analysis_callgraph.erl
parent7f3b77274958b62523e83ab2b37ad29ec9a6cf3c (diff)
downloadotp-7a6ea7e9946e72a03167145c476e66ee77098b6e.tar.gz
otp-7a6ea7e9946e72a03167145c476e66ee77098b6e.tar.bz2
otp-7a6ea7e9946e72a03167145c476e66ee77098b6e.zip
dialyzer: Optimize memory consumption
Some SCC info is no longer cached. It reduces the peak memory consumption of workers during the typesig phase, and seems to cost very little time.
Diffstat (limited to 'lib/dialyzer/src/dialyzer_analysis_callgraph.erl')
-rw-r--r--lib/dialyzer/src/dialyzer_analysis_callgraph.erl4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/dialyzer/src/dialyzer_analysis_callgraph.erl b/lib/dialyzer/src/dialyzer_analysis_callgraph.erl
index 8b3f70aa23..c8129cfbaa 100644
--- a/lib/dialyzer/src/dialyzer_analysis_callgraph.erl
+++ b/lib/dialyzer/src/dialyzer_analysis_callgraph.erl
@@ -121,6 +121,7 @@ loop(#server_state{parent = Parent} = State,
%% The Analysis
%%--------------------------------------------------------------------
+%% Calls to erlang:garbage_collect() help to reduce the heap size.
analysis_start(Parent, Analysis, LegalWarnings) ->
CServer = dialyzer_codeserver:new(),
Plt = Analysis#analysis.plt,
@@ -157,6 +158,7 @@ analysis_start(Parent, Analysis, LegalWarnings) ->
TmpCServer1 = dialyzer_codeserver:set_temp_records(MergedRecords, TmpCServer0),
TmpCServer2 =
dialyzer_codeserver:finalize_exported_types(MergedExpTypes, TmpCServer1),
+ erlang:garbage_collect(),
?timing(State#analysis_state.timing_server, "remote",
begin
TmpCServer3 =
@@ -185,8 +187,6 @@ analysis_start(Parent, Analysis, LegalWarnings) ->
true -> dialyzer_callgraph:put_race_detection(true, Callgraph);
false -> Callgraph
end,
- %% Calls to erlang:garbage_collect() help to reduce the heap size.
- %% An alternative is to spawn more processes to do the job(s).
erlang:garbage_collect(),
State2 = analyze_callgraph(NewCallgraph, State1),
#analysis_state{plt = MiniPlt2, doc_plt = DocPlt} = State2,