Skip to content

Tcmalloc fixes - #5407

Open
graydon wants to merge 2 commits into
stellar:masterfrom
graydon:tcmalloc-fixes
Open

Tcmalloc fixes#5407
graydon wants to merge 2 commits into
stellar:masterfrom
graydon:tcmalloc-fixes

Conversation

@graydon

@graydon graydon commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

This improves our ability to do memory profiling .. a bit:

  • adds a --disable-tcmalloc so that you can use memory profilers that hook malloc like heaptrack
  • fixes --enable-tracy-memory-tracking which was broken
  • adds a doc about using them
  • adds support for measuring the heap dynamically when tcmalloc is turned on
  • does so during wasm compilation and reports a new metric
  • renames the old metric to be even more clear that it's wasm bytes not memory

Copilot AI balanced review requested due to automatic review settings August 7, 2026 07:23

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds configurable tcmalloc support, repairs Tracy memory-tracking configuration, and introduces heap measurements for Soroban module-cache compilation.

Changes:

  • Adds --disable-tcmalloc and Tracy memory-tracking build flags.
  • Reports WASM and heap-byte metrics during module-cache rebuilds.
  • Documents Tracy and Heaptrack profiling workflows.

Reviewed changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
configure.ac Adds allocator configuration and compatibility checks.
common.mk Defines Tracy memory-tracking flags.
src/util/TcmallocConfig.h Declares heap-usage query API.
src/util/TcmallocConfig.cpp Queries tcmalloc heap usage.
src/ledger/SharedModuleCacheCompiler.h Tracks compilation heap measurements.
src/ledger/SharedModuleCacheCompiler.cpp Samples and logs heap changes.
src/ledger/SorobanMetrics.h Declares renamed and new metrics.
src/ledger/SorobanMetrics.cpp Registers module-cache byte metrics.
src/ledger/LedgerManagerImpl.cpp Publishes rebuild measurements.
src/transactions/test/InvokeHostFunctionTests.cpp Updates renamed metric references.
docs/metrics.md Documents metric changes.
performance-eval/performance-eval.md Adds memory-profiling guidance.
INSTALL.md Moves Windows Tracy instructions.
Builds/VisualStudio/stellar-core.vcxproj Adds new utility sources.
Builds/VisualStudio/stellar-core.vcxproj.filters Categorizes new utility sources.

Comment thread common.mk
Comment thread performance-eval/performance-eval.md Outdated
Comment thread performance-eval/performance-eval.md Outdated
Comment thread INSTALL.md Outdated
Comment thread src/util/TcmallocConfig.h
Comment thread src/ledger/SharedModuleCacheCompiler.cpp Outdated
Comment thread performance-eval/performance-eval.md Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants