aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/buildtool
diff options
context:
space:
mode:
authorGravatar janakr <janakr@google.com>2018-07-26 15:16:27 -0700
committerGravatar Copybara-Service <copybara-piper@google.com>2018-07-26 15:18:06 -0700
commit5194dfd8bafd27dfc2d86efba1265bf2b8b3fa78 (patch)
tree757b5365634154a714db9f2864270eafcad58c47 /src/main/java/com/google/devtools/build/lib/buildtool
parent1f3d3ea64e5982a86fffadc1d7131fee84f9cba9 (diff)
Don't retain memory used by Artifact->owner Label multimap after it's been used at the start of execution.
PiperOrigin-RevId: 206230049
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/buildtool')
-rw-r--r--src/main/java/com/google/devtools/build/lib/buildtool/ExecutionTool.java6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/buildtool/ExecutionTool.java b/src/main/java/com/google/devtools/build/lib/buildtool/ExecutionTool.java
index d31e0d1f4b..44a5fd7aab 100644
--- a/src/main/java/com/google/devtools/build/lib/buildtool/ExecutionTool.java
+++ b/src/main/java/com/google/devtools/build/lib/buildtool/ExecutionTool.java
@@ -302,8 +302,6 @@ public class ExecutionTool {
Set<AspectKey> builtAspects = new HashSet<>();
Collection<AspectValue> aspects = analysisResult.getAspects();
- SetMultimap<Artifact, Label> topLevelArtifactsToOwnerLabels =
- TopLevelArtifactHelper.makeTopLevelArtifactsToOwnerLabels(analysisResult, aspects);
if (request.isRunningInEmacs()) {
// The syntax of this message is tightly constrained by lisp/progmodes/compile.el in emacs
request
@@ -313,12 +311,16 @@ public class ExecutionTool {
}
boolean buildCompleted = false;
try {
+ SetMultimap<Artifact, Label> topLevelArtifactsToOwnerLabels =
+ TopLevelArtifactHelper.makeTopLevelArtifactsToOwnerLabels(analysisResult, aspects);
for (ActionContextProvider actionContextProvider : actionContextProviders) {
try (SilentCloseable c =
Profiler.instance().profile(actionContextProvider + ".executionPhaseStarting")) {
actionContextProvider.executionPhaseStarting(actionGraph, topLevelArtifactsToOwnerLabels);
}
}
+ // Don't retain memory.
+ topLevelArtifactsToOwnerLabels = null;
executor.executionPhaseStarting();
skyframeExecutor.drainChangedFiles();