Skip to content

src: expose size and count in heap profile output - #65737

Open
IlyasShabi wants to merge 1 commit into
nodejs:mainfrom
IlyasShabi:ishabi/heap-size-count
Open

src: expose size and count in heap profile output#65737
IlyasShabi wants to merge 1 commit into
nodejs:mainfrom
IlyasShabi:ishabi/heap-size-count

Conversation

@IlyasShabi

Copy link
Copy Markdown
Member

v8.startHeapProfile().stop() returns the sampling heap profile in the CDT format. That format reports only size (= objectSize × objectCount) per sample and selfSize per node, discarding the object count and the live/collected distinction that V8 already tracks.

In this PR every existing CDT field keeps its name and value, and :

  • Nodes: add selfCount (number of sampled objects) alongside selfSize (total bytes).
  • Samples: add objectSize, objectCount, and isLive.

@nodejs-github-bot nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. needs-ci PRs that need a full CI run. labels Sep 2, 2026
Signed-off-by: ishabi <ilyasshabi94@gmail.com>
@IlyasShabi
IlyasShabi force-pushed the ishabi/heap-size-count branch from 30b4ca6 to 55080ea Compare September 2, 2026 09:48
@codecov

codecov Bot commented Sep 2, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.98%. Comparing base (5ed55ba) to head (55080ea).
⚠️ Report is 5 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #65737      +/-   ##
==========================================
- Coverage   90.05%   89.98%   -0.07%     
==========================================
  Files         754      755       +1     
  Lines      256518   257288     +770     
  Branches    48534    48772     +238     
==========================================
+ Hits       231007   231527     +520     
- Misses      16609    16863     +254     
+ Partials     8902     8898       -4     
Files with missing lines Coverage Δ
src/node_profiling.cc 82.50% <100.00%> (+1.41%) ⬆️

... and 45 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

c++ Issues and PRs that require attention from people who are familiar with C++. needs-ci PRs that need a full CI run.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants