Skip to content

Commit

Permalink
Reference the correct version of the java allocation instrumenter.
Browse files Browse the repository at this point in the history
It was updated in bazelbuild@affc27f

Part of bazelbuild#13726.

Closes bazelbuild#13734.

PiperOrigin-RevId: 386415693
  • Loading branch information
meisterT authored and katre committed Jul 23, 2021
1 parent 1f1ac84 commit 4ac6e06
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion site/docs/skylark/performance.md
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,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.
Expand Down
10 changes: 5 additions & 5 deletions site/docs/user-manual.html
Original file line number Diff line number Diff line change
Expand Up @@ -2709,30 +2709,30 @@ <h4 id='memory-tracking'>Memory tracking</h4>
startup flags to Bazel:
</p>
<ul>
<li><code>--host_jvm_args=-javaagent:$BAZEL/third_party/allocation_instrumenter/java-allocation-instrumenter-3.0.1.jar</code></li>
<li><code>--host_jvm_args=-javaagent:$BAZEL/third_party/allocation_instrumenter/java-allocation-instrumenter-3.3.0.jar</code></li>
<li><code>--host_jvm_args=-DRULE_MEMORY_TRACKER=1</code></li>
</ul>
<p>
The java-agent is checked into Bazel at
third_party/allocation_instrumenter/java-allocation-instrumenter-3.0.1.jar, so make
third_party/allocation_instrumenter/java-allocation-instrumenter-3.3.0.jar, so make
sure you adjust <code>$BAZEL</code> 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.
</p>
<p>Example:</p>
<pre>
% 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 &lt;targets&gt;

# 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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
* <li>--host_jvm_args=-javaagent:(path to Google's java agent jar)
* <ul>
* <li>For Bazel use <a
* href="https://github.com/bazelbuild/bazel/tree/master/third_party/allocation_instrumenter">java-allocation-instrumenter-3.0.1.jar</a>
* href="https://github.com/bazelbuild/bazel/tree/master/third_party/allocation_instrumenter">java-allocation-instrumenter-3.3.0.jar</a>
* </ul>
* <li>--host_jvm_args=-DRULE_MEMORY_TRACKER=1
* </ol>
Expand Down

0 comments on commit 4ac6e06

Please sign in to comment.