diff options
author | janakr <janakr@google.com> | 2018-02-28 09:46:06 -0800 |
---|---|---|
committer | Copybara-Service <copybara-piper@google.com> | 2018-02-28 09:48:17 -0800 |
commit | dfa0b12a44c6cd434de612db2c6b5573ef4e64bb (patch) | |
tree | f601c579874ebcbeee6881c1e274b194f6ac9550 /src/main/java/com/google/devtools/build/lib/runtime/CommonCommandOptions.java | |
parent | 1fe23126d4a30d49b7668b235ea1bfb2e2c8a39e (diff) |
Add functionality to MemoryProfiler to do multiple garbage collections at the end of the build in an effort to get an accurate measurement of used memory.
PiperOrigin-RevId: 187337487
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/runtime/CommonCommandOptions.java')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/runtime/CommonCommandOptions.java | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/runtime/CommonCommandOptions.java b/src/main/java/com/google/devtools/build/lib/runtime/CommonCommandOptions.java index 238eb225d6..ea9c7fa057 100644 --- a/src/main/java/com/google/devtools/build/lib/runtime/CommonCommandOptions.java +++ b/src/main/java/com/google/devtools/build/lib/runtime/CommonCommandOptions.java @@ -15,6 +15,7 @@ package com.google.devtools.build.lib.runtime; import static com.google.common.base.Strings.isNullOrEmpty; +import com.google.devtools.build.lib.profiler.MemoryProfiler.MemoryProfileStableHeapParameters; import com.google.devtools.build.lib.runtime.CommandLineEvent.ToolCommandLineEvent; import com.google.devtools.build.lib.util.OptionsUtils; import com.google.devtools.build.lib.vfs.PathFragment; @@ -229,11 +230,26 @@ public class CommonCommandOptions extends OptionsBase { documentationCategory = OptionDocumentationCategory.UNDOCUMENTED, effectTags = {OptionEffectTag.AFFECTS_OUTPUTS, OptionEffectTag.BAZEL_MONITORING}, converter = OptionsUtils.PathFragmentConverter.class, - help = "If set, write memory usage data to the specified file at phase ends." + help = + "If set, write memory usage data to the specified file at phase ends and stable heap to" + + " master log at end of build." ) public PathFragment memoryProfilePath; @Option( + name = "memory_profile_stable_heap_parameters", + defaultValue = "1,0", + documentationCategory = OptionDocumentationCategory.LOGGING, + effectTags = {OptionEffectTag.BAZEL_MONITORING}, + converter = MemoryProfileStableHeapParameters.Converter.class, + help = + "Tune memory profile's computation of stable heap at end of build. Should be two integers " + + "separated by a comma. First parameter is the number of GCs to perform. Second " + + "parameter is the number of seconds to wait between GCs." + ) + public MemoryProfileStableHeapParameters memoryProfileStableHeapParameters; + + @Option( name = "experimental_oom_more_eagerly_threshold", defaultValue = "100", documentationCategory = OptionDocumentationCategory.EXECUTION_STRATEGY, @@ -362,4 +378,5 @@ public class CommonCommandOptions extends OptionsBase { + "or the bad combination should be checked for programmatically." ) public List<String> deprecationWarnings; + } |