From a50b7b710b423af2ac00f3cf4e238449efbf48c7 Mon Sep 17 00:00:00 2001 From: Janak Ramakrishnan Date: Thu, 2 Jun 2016 21:46:40 +0000 Subject: Don't create CommandCompleteEvent for OOMs ahead of time. Its super-constructor records timestamps and gc stats under the covers, so that data will be inaccurate. -- MOS_MIGRATED_REVID=123909692 --- .../com/google/devtools/build/lib/runtime/BlazeRuntime.java | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) (limited to 'src/main/java/com/google/devtools/build/lib/runtime/BlazeRuntime.java') diff --git a/src/main/java/com/google/devtools/build/lib/runtime/BlazeRuntime.java b/src/main/java/com/google/devtools/build/lib/runtime/BlazeRuntime.java index 8cb02632c2..3a51bb717c 100644 --- a/src/main/java/com/google/devtools/build/lib/runtime/BlazeRuntime.java +++ b/src/main/java/com/google/devtools/build/lib/runtime/BlazeRuntime.java @@ -141,10 +141,6 @@ public final class BlazeRuntime { private static final Logger LOG = Logger.getLogger(BlazeRuntime.class.getName()); - // Pre-allocate memory for this object in case of an OOM. - private static final CommandCompleteEvent OOM_COMMAND_COMPLETE_EVENT = - new CommandCompleteEvent(ExitCode.OOM_ERROR.getNumericExitCode()); - private final Iterable blazeModules; private final Map commandMap = new LinkedHashMap<>(); private final Clock clock; @@ -519,11 +515,7 @@ public final class BlazeRuntime { // thread won the race (unlikely, but possible), this may be incorrectly logged as a success. return; } - CommandCompleteEvent commandCompleteEvent = - exitCode == ExitCode.OOM_ERROR.getNumericExitCode() - ? OOM_COMMAND_COMPLETE_EVENT - : new CommandCompleteEvent(exitCode); - workspace.getSkyframeExecutor().getEventBus().post(commandCompleteEvent); + workspace.getSkyframeExecutor().getEventBus().post(new CommandCompleteEvent(exitCode)); } /** -- cgit v1.2.3