Skip to content

Conversation

@caiolima
Copy link
Contributor

@caiolima caiolima commented Nov 4, 2025

This PR adds to Node's HeapStatistics API a new field called total_allocated_bytes that contains the total bytes allocated since the creation of an isolate. This extension comes from the extension added recently in V8 on v8/v8@fe81545. The major use case for this information is to allow creating of regression tests tracking allocations.

@nodejs-github-bot nodejs-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 Nov 4, 2025
@caiolima caiolima force-pushed the expose-total-allocated-bytes branch from 611be50 to 0f52825 Compare November 4, 2025 12:07
@caiolima caiolima changed the title feat: adding total_allocated_bytes to Node's API node-api: adding total_allocated_bytes to HeapStatistics Nov 4, 2025
@legendecas
Copy link
Member

The subsystem should be v8, rather than node-api.

@legendecas legendecas added the v8 module Issues and PRs related to the "v8" subsystem. label Nov 4, 2025
@caiolima caiolima changed the title node-api: adding total_allocated_bytes to HeapStatistics v8: adding total_allocated_bytes to HeapStatistics Nov 4, 2025
@caiolima caiolima force-pushed the expose-total-allocated-bytes branch from 0f52825 to b198157 Compare November 4, 2025 12:28
@caiolima
Copy link
Contributor Author

caiolima commented Nov 4, 2025

The subsystem should be v8, rather than node-api.

Changed. Thanks!

@codecov
Copy link

codecov bot commented Nov 4, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.56%. Comparing base (4346c0f) to head (b198157).
⚠️ Report is 36 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #60573      +/-   ##
==========================================
+ Coverage   88.55%   88.56%   +0.01%     
==========================================
  Files         704      704              
  Lines      207981   208075      +94     
  Branches    40068    40080      +12     
==========================================
+ Hits       184173   184281     +108     
+ Misses      15854    15831      -23     
- Partials     7954     7963       +9     
Files with missing lines Coverage Δ
lib/v8.js 99.03% <100.00%> (+<0.01%) ⬆️
src/node_v8.cc 81.51% <ø> (ø)
src/node_worker.cc 81.62% <100.00%> (+0.01%) ⬆️

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

@addaleax addaleax added semver-minor PRs that contain new features and should be released in the next minor version. request-ci Add this label to start a Jenkins CI on a PR. author ready PRs that have at least one approval, no pending requests for changes, and a CI started. labels Nov 4, 2025
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Nov 4, 2025
@nodejs-github-bot
Copy link
Collaborator

@joyeecheung joyeecheung added the request-ci Add this label to start a Jenkins CI on a PR. label Nov 4, 2025
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Nov 4, 2025
@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@caiolima
Copy link
Contributor Author

caiolima commented Nov 6, 2025

Hi all, thank you very much for the reviews here. Looking into those failures, they seem unrelated to my patch. Could anybody trigger CI again to me, please?

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@legendecas legendecas added the commit-queue Add this label to land a pull request using GitHub Actions. label Nov 7, 2025
@nodejs-github-bot nodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Nov 7, 2025
@nodejs-github-bot nodejs-github-bot merged commit ed6569c into nodejs:main Nov 7, 2025
78 of 79 checks passed
@nodejs-github-bot
Copy link
Collaborator

Landed in ed6569c

@caiolima caiolima deleted the expose-total-allocated-bytes branch November 7, 2025 15:56
@caiolima
Copy link
Contributor Author

caiolima commented Nov 7, 2025

Thank you very much!

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

Labels

author ready PRs that have at least one approval, no pending requests for changes, and a CI started. 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. semver-minor PRs that contain new features and should be released in the next minor version. v8 module Issues and PRs related to the "v8" subsystem.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants