google /bloaty

Bloaty: a size profiler for binaries

★ 5,573⑂ 383👁 73⑃ 317● 211▤ 2
C++Apache-2.0Created 2016-11-07
Download: Bloaty McBloatface v1.1Bloaty-1.1 ↓1.12020-05-24
+0
Daily
5,573
stars
383
forks
73
watchers
317
prs
211
issues
2
releases

README

Bloaty: a size profiler for binaries



Ever wondered what's making your binary big?  Bloaty will
show you a size profile of the binary so you can understand
what's taking up space inside.

cmdoutput
$ ./bloaty bloaty -d compileunits
    FILE SIZE        VM SIZE    
 --------------  -------------- 
  34.8%  10.2Mi  43.4%  2.91Mi    [163 Others]
  17.2%  5.08Mi   4.3%   295Ki    third_party/protobuf/src/google/protobuf/descriptor.cc
   7.3%  2.14Mi   2.6%   179Ki    third_party/protobuf/src/google/protobuf/descriptor.pb.cc
   4.6%  1.36Mi   1.1%  78.4Ki    third_party/protobuf/src/google/protobuf/text_format.cc
   3.7%  1.10Mi   4.5%   311Ki    third_party/capstone/arch/ARM/ARMDisassembler.c
   1.3%   399Ki  15.9%  1.07Mi    third_party/capstone/arch/M68K/M68KDisassembler.c
   3.2%   980Ki   1.1%  75.3Ki    third_party/protobuf/src/google/protobuf/generated_message_reflection.cc
   3.2%   965Ki   0.6%  40.7Ki    third_party/protobuf/src/google/protobuf/descriptor_database.cc
   2.8%   854Ki  12.0%   819Ki    third_party/capstone/arch/X86/X86Mapping.c
   2.8%   846Ki   1.0%  66.4Ki    third_party/protobuf/src/google/protobuf/extension_set.cc
   2.7%   800Ki   0.6%  41.2Ki    third_party/protobuf/src/google/protobuf/generated_message_util.cc
   2.3%   709Ki   0.7%  50.7Ki    third_party/protobuf/src/google/protobuf/wire_format.cc
   2.1%   637Ki   1.7%   117Ki    third_party/demumble/third_party/libcxxabi/cxa_demangle.cpp
   1.8%   549Ki   1.7%   114Ki    src/bloaty.cc
   1.7%   503Ki   0.7%  48.1Ki    third_party/protobuf/src/google/protobuf/repeated_field.cc
   1.6%   469Ki   6.2%   427Ki    third_party/capstone/arch/X86/X86DisassemblerDecoder.c
   1.4%   434Ki   0.2%  15.9Ki    third_party/protobuf/src/google/protobuf/message.cc
   1.4%   422Ki   0.3%  23.4Ki    third_party/re2/re2/dfa.cc
   1.3%   407Ki   0.4%  24.9Ki    third_party/re2/re2/regexp.cc
   1.3%   407Ki   0.4%  29.9Ki    third_party/protobuf/src/google/protobuf/map_field.cc
   1.3%   397Ki   0.4%  24.8Ki    third_party/re2/re2/re2.cc
 100.0%  29.5Mi 100.0%  6.69Mi    TOTAL


Bloaty performs a deep analysis of the binary. Using custom
ELF, DWARF, and Mach-O parsers, Bloaty aims to accurately
attribute every byte of the binary to the symbol or
compileunit that produced it. It will even disassemble the
binary looking for references to anonymous data.

Bloaty supports many features:

- file formats: ELF, Mach-O, PE/COFF (experimental), WebAssembly (experimental)
- data sources: compileunit (shown above), symbol, section, segment, etc.
- hierarchical profiles: combine multiple data sources into a single report
- size diffs: see where the binary grew, perfect for CI tests
- separate debug files: strip the binary under test, while making debug data available for analysis
- flexible demangling: demangle C++ symbols, optionally discarding function/template parameters
- custom data sources: regex rewrites of built-in data sources, for custom munging/bucketing
- regex filtering: filter out par

Top issues

Latest release

Bloaty McBloatface v1.1 v1.1 2020-05-24
Added

 Source Filtering: Bloaty can now filter the results based on a regex
  match. See "Source filter" in README.md for details. (177)
 Show only File or VM: It is possible to restrict the output to show only
  "VM SIZE" or "FILE SIZE" by passing --domain=vm or --domain=file. (165)

 Fixed

 Use system deps in CMake build: The CMake build can now use system deps
  for protobuf, capstone, and re2 if they are present. Hopefully this will make
  Bloaty easier to package in package managers. (155)
 DWARF 4 Support: Fixed one place in Bloaty that was not accepting DWARF 4.
  (166)

Snapshot: 2026-11-16T09:23:14Z · Data license Apache-2.0 · JSON