Bazel 6 standard memory profiling only shows info about a fraction of used memory. How to get a full memory usage breakdown? #21717
Unanswered
andrii-korotkov-verkada
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I've followed https://bazel.build/rules/performance#memory-profiling and did several bazel runs. In each of them I'd build almost the whole codebase and did bazel shutdown in between them. I've looked at memory usage as reported by:
(1) Bazel memory usage from the timing chart.
(2) Output of
info used-heap-size-after-gc
(3) Breakdown by
dump --rules
(4) Breakdown of skylark memory via pprof.
I've found is (1) is several hundreds of megabytes higher than (2), around 7-8GB overall ((2) is 6-7GB depending on the run and setup).
However, the total memory from (3) and (4) was consistently <1GB. So it doesn't show the all memory usage breakdown.
I did two runs, one with all build artifacts cached, which still used ~6GB based on (2). Another run was with a small change made to the common code, which resulted in a big amount of rebuilds and ~7GB of memory usage based on (2). The usage chart from (1) reached the peak and then kept dropping and increasing again. However, (3) and (4) still reported a quite small fraction of that memory usage.
The conclusion I probably can make is that packages loading and analysis phase consume most of the memory. However, I can't find a way to break this down, as (3) and (4) seem to either be related to the build phase only or somehow miss a big amount of memory in some other way. Can you suggest how I can proceed, please?
Beta Was this translation helpful? Give feedback.
All reactions