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 committed Jul 26, 2021
1 parent 16e91d3 commit 7efabba
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion site/docs/skylark/performance.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
14 changes: 7 additions & 7 deletions site/docs/user-manual.html
Original file line number Diff line number Diff line change
Expand Up @@ -2613,30 +2613,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
sure you adjust <code>$BAZEL</code> 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 <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 7efabba

Please sign in to comment.