Skip to content

v8: add heap profile API - #60231

Open
theanarkh wants to merge 1 commit into
nodejs:mainfrom
theanarkh:add_v8_heap_profile
Open

v8: add heap profile API#60231
theanarkh wants to merge 1 commit into
nodejs:mainfrom
theanarkh:add_v8_heap_profile

Conversation

@theanarkh

Copy link
Copy Markdown
Contributor

Refs: #59807

  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/web-infra

@nodejs-github-botnodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. lib / src Issues and PRs related to general changes in the lib or src directory. needs-ci PRs that need a full CI run. labels Oct 12, 2025
@codecov

codecovBot commented Oct 12, 2025

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 77.77778% with 22 lines in your changes missing coverage. Please review.
✅ Project coverage is 88.57%. Comparing base (f9fcc74) to head (9024efa).
⚠️ Report is 2354 commits behind head on main.

Files with missing linesPatch %Lines
src/util.cc68.88%10 Missing and 4 partials ⚠️
lib/v8.js82.14%5 Missing ⚠️
src/node_v8.cc87.50%1 Missing and 2 partials ⚠️
Additional details and impacted files
@@ Coverage Diff @@## main #60231 +/- ##
=======================================
Coverage 88.56% 88.57% =======================================
Files 704 704 Lines 208125 208176 +51 Branches 40003 40019 +16 =======================================
+ Hits 184332 184386 +54 - Misses 15809 15822 +13 + Partials 7984 7968 -16 
Files with missing linesCoverage Δ
src/node_worker.cc82.41% <100.00%> (+0.71%)⬆️
src/node_worker.h91.66% <ø> (ø)
src/util.h90.59% <ø> (ø)
src/node_v8.cc81.78% <87.50%> (+0.27%)⬆️
lib/v8.js98.15% <82.14%> (-0.88%)⬇️
src/util.cc84.26% <68.88%> (-1.42%)⬇️

... and 38 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.

Comment threadsrc/node_v8.cc
Comment threadsrc/node_v8.cc
@@ -279,6 +279,30 @@ void StopCpuProfile(const FunctionCallbackInfo<Value>& args) {
}
}

void StartHeapProfile(const FunctionCallbackInfo<Value>& args) {
Isolate* isolate = args.GetIsolate();
if (isolate->GetHeapProfiler()->StartSamplingHeapProfiler()) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think it's better for if the API support arguments sample_interval and stack_depth

@IlyasShabi

Copy link
Copy Markdown
Member

Hey @theanarkh! are you still planning to work on this feature?

@theanarkh

Copy link
Copy Markdown
ContributorAuthor

Hey @theanarkh! are you still planning to work on this feature?

I might not have time recently. Could you help implement this feature?

@IlyasShabiIlyasShabi mentioned this pull request Mar 16, 2026
@github-actions

Copy link
Copy Markdown
Contributor

This pull request has been marked as stale due to 90 days of inactivity.
It will be automatically closed in 30 days if no further activity occurs. If this is still relevant, please leave a comment or update it to keep it open.

Sign up for freeto 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++.lib / srcIssues and PRs related to general changes in the lib or src directory.needs-ciPRs that need a full CI run.stale

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@theanarkh@nodejs-github-bot@IlyasShabi