From 7efabba19cf6400bf9e707f53b40a6dd7110fafb Mon Sep 17 00:00:00 2001 From: Tobias Werth Date: Fri, 23 Jul 2021 02:38:02 -0700 Subject: [PATCH] Reference the correct version of the java allocation instrumenter. It was updated in https://github.com/bazelbuild/bazel/commit/affc27f9d18f9781437e91a3f36c73962a56f261 Part of #13726. Closes #13734. PiperOrigin-RevId: 386415693 --- site/docs/skylark/performance.md | 2 +- site/docs/user-manual.html | 14 +++++++------- .../profiler/memory/AllocationTrackerModule.java | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/site/docs/skylark/performance.md b/site/docs/skylark/performance.md index f6b6f0b905e0a2..1cb0613afcba67 100644 --- a/site/docs/skylark/performance.md +++ b/site/docs/skylark/performance.md @@ -366,7 +366,7 @@ You must pass these two startup flags to *every* Bazel invocation: ``` STARTUP_FLAGS=\ - --host_jvm_args=-javaagent:$(BAZEL)/third_party/allocation_instrumenter/java-allocation-instrumenter-3.0.1.jar \ + --host_jvm_args=-javaagent:$(BAZEL)/third_party/allocation_instrumenter/java-allocation-instrumenter-3.3.0.jar \ --host_jvm_args=-DRULE_MEMORY_TRACKER=1 ``` **NOTE**: The bazel repository comes with an allocation instrumenter. diff --git a/site/docs/user-manual.html b/site/docs/user-manual.html index d98598de0fb425..ed4be1f60f7c88 100644 --- a/site/docs/user-manual.html +++ b/site/docs/user-manual.html @@ -2613,30 +2613,30 @@

Memory tracking

startup flags to Bazel:

- The java-agent is checked into bazel at - third_party/allocation_instrumenter/java-allocation-instrumenter-3.0.1.jar, so make - sure you adjust $BAZEL for where you keep your bazel repository. + The java-agent is checked into Bazel at + third_party/allocation_instrumenter/java-allocation-instrumenter-3.3.0.jar, so make + sure you adjust $BAZEL for where you keep your Bazel repository. Do not forget to keep passing these options to Bazel for every command or the server will restart.

Example:

-    % bazel --host_jvm_args=-javaagent:$BAZEL/third_party/allocation_instrumenter/java-allocation-instrumenter-3.0.1.jar \
+    % bazel --host_jvm_args=-javaagent:$BAZEL/third_party/allocation_instrumenter/java-allocation-instrumenter-3.3.0.jar \
     --host_jvm_args=-DRULE_MEMORY_TRACKER=1 \
     build --nobuild <targets>
 
     # Dump rules
-    % bazel --host_jvm_args=-javaagent:$BAZEL/third_party/allocation_instrumenter/java-allocation-instrumenter-3.0.1.jar \
+    % bazel --host_jvm_args=-javaagent:$BAZEL/third_party/allocation_instrumenter/java-allocation-instrumenter-3.3.0.jar \
     --host_jvm_args=-DRULE_MEMORY_TRACKER=1 \
     dump --rules
 
     # Dump Starlark heap and analyze it with pprof
-    % bazel --host_jvm_args=-javaagent:$BAZEL/third_party/allocation_instrumenter/java-allocation-instrumenter-3.0.1.jar \
+    % bazel --host_jvm_args=-javaagent:$BAZEL/third_party/allocation_instrumenter/java-allocation-instrumenter-3.3.0.jar \
     --host_jvm_args=-DRULE_MEMORY_TRACKER=1 \
     dump --skylark_memory=$HOME/prof.gz
     % pprof -flame $HOME/prof.gz
diff --git a/src/main/java/com/google/devtools/build/lib/profiler/memory/AllocationTrackerModule.java b/src/main/java/com/google/devtools/build/lib/profiler/memory/AllocationTrackerModule.java
index d0870d67a0647b..2c6034d137d9f1 100644
--- a/src/main/java/com/google/devtools/build/lib/profiler/memory/AllocationTrackerModule.java
+++ b/src/main/java/com/google/devtools/build/lib/profiler/memory/AllocationTrackerModule.java
@@ -36,7 +36,7 @@
  *   
  • --host_jvm_args=-javaagent:(path to Google's java agent jar) *
      *
    • For Bazel use java-allocation-instrumenter-3.0.1.jar + * href="https://github.com/bazelbuild/bazel/tree/master/third_party/allocation_instrumenter">java-allocation-instrumenter-3.3.0.jar *
    *
  • --host_jvm_args=-DRULE_MEMORY_TRACKER=1 *