From 5af6138f293985bb13e3ae46eab7ac8e10ab6db1 Mon Sep 17 00:00:00 2001 From: tomlu Date: Mon, 30 Oct 2017 18:01:48 -0400 Subject: Internal change PiperOrigin-RevId: 173955012 --- site/docs/user-manual.html | 68 ++++++++++++++++++++++------------------------ 1 file changed, 33 insertions(+), 35 deletions(-) (limited to 'site/docs/user-manual.html') diff --git a/site/docs/user-manual.html b/site/docs/user-manual.html index d6899803f2..096688f582 100644 --- a/site/docs/user-manual.html +++ b/site/docs/user-manual.html @@ -3246,42 +3246,40 @@ adb -s deadbeef install ... You must enable memory tracking for this to work. - --> -

Memory tracking

-

- Some dump commands require memory tracking. To turn this on, you have to pass - 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. - - 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 \
-  --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 \
-  --host_jvm_args=-DRULE_MEMORY_TRACKER=1 \
-  dump --rules
-
-  # Dump Skylark heap and analyze it with pprof
-  % bazel --host_jvm_args=-javaagent:$BAZEL/third_party/allocation_instrumenter/java-allocation-instrumenter-3.0.1.jar \
-  --host_jvm_args=-DRULE_MEMORY_TRACKER=1 \
-  dump --skylark_memory=$HOME/prof.gz
-  % pprof -flame $HOME/prof.gz
-
+

Memory tracking

+

+ Some dump commands require memory tracking. To turn this on, you have to pass + 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. + 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 \
+    --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 \
+    --host_jvm_args=-DRULE_MEMORY_TRACKER=1 \
+    dump --rules
+
+    # Dump Skylark heap and analyze it with pprof
+    % bazel --host_jvm_args=-javaagent:$BAZEL/third_party/allocation_instrumenter/java-allocation-instrumenter-3.0.1.jar \
+    --host_jvm_args=-DRULE_MEMORY_TRACKER=1 \
+    dump --skylark_memory=$HOME/prof.gz
+    % pprof -flame $HOME/prof.gz
+  

The analyze-profile command

-- cgit v1.2.3