summaryrefslogtreecommitdiff
path: root/java/droiddoc.go
diff options
context:
space:
mode:
author Anton Hansson <hansson@google.com> 2020-10-26 09:57:40 +0000
committer Anton Hansson <hansson@google.com> 2020-10-26 11:38:40 +0000
commit52ac73d21ec9c75f76efb921c7454c233b94ee00 (patch)
treecb66f4d1f417e93f70daf6773662ae9b1b6f07cb /java/droiddoc.go
parent1e8118da95fca42e911469168d9f2fc082a05691 (diff)
Make highmem classification of metalava optional
We have added a lot of metalava invocations since the highmem differentation was added, most of which do not use a lot of memory. By collecting data of max rss per process we have narrowed down the set of highmem modules to a smaller set, and will annotate the relevant modules as such. Bug: 170701554 Test: NINJA_HIGHMEM_NUM_JOBS=3 m checkapi (no long tail of metalava) Change-Id: Ic9c8c91388b02889111ef596fc6fd8bde9b42b9d
Diffstat (limited to 'java/droiddoc.go')
-rw-r--r--java/droiddoc.go11
1 files changed, 9 insertions, 2 deletions
diff --git a/java/droiddoc.go b/java/droiddoc.go
index 344b15e95..1e09d6474 100644
--- a/java/droiddoc.go
+++ b/java/droiddoc.go
@@ -262,6 +262,10 @@ type DroidstubsProperties struct {
// TODO(b/146727827): Remove capability when we do not need to generate stubs and API separately.
Generate_stubs *bool
+ // if set to true, provides a hint to the build system that this rule uses a lot of memory,
+ // whicih can be used for scheduling purposes
+ High_mem *bool
+
// is set to true, Metalava will allow framework SDK to contain API levels annotations.
Api_levels_annotations_enabled *bool
@@ -1260,8 +1264,6 @@ func (d *Droidstubs) apiLevelsAnnotationsFlags(ctx android.ModuleContext, cmd *a
func metalavaCmd(ctx android.ModuleContext, rule *android.RuleBuilder, javaVersion javaVersion, srcs android.Paths,
srcJarList android.Path, bootclasspath, classpath classpath, sourcepaths android.Paths, implicitsRsp android.WritablePath, sandbox bool) *android.RuleBuilderCommand {
- // Metalava uses lots of memory, restrict the number of metalava jobs that can run in parallel.
- rule.HighMem()
cmd := rule.Command()
if ctx.Config().UseRBE() && ctx.Config().IsEnvTrue("RBE_METALAVA") {
rule.Remoteable(android.RemoteRuleSupports{RBE: true})
@@ -1343,6 +1345,11 @@ func (d *Droidstubs) GenerateAndroidBuildActions(ctx android.ModuleContext) {
rule := android.NewRuleBuilder()
+ if BoolDefault(d.properties.High_mem, false) {
+ // This metalava run uses lots of memory, restrict the number of metalava jobs that can run in parallel.
+ rule.HighMem()
+ }
+
generateStubs := BoolDefault(d.properties.Generate_stubs, true)
var stubsDir android.OptionalPath
if generateStubs {