Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deps: V8: cherry-pick c172ffc5bf54 #57437

Merged
merged 1 commit into from
Mar 16, 2025

Conversation

tunamagur0
Copy link
Contributor

fix: #57412

This upstream V8 commit fixes the issue where the size of RetainedMaps continuously increases, leading to higher memory usage.

This issue has been occurring since AddRetainedMap was changed to AddRetainedMaps in the commit d8c97e48573ef9679751be0c7a308e08d0101c47.

As a result, the Main branch, v23.x.x, and v22.x.x should need this.

Original commit message:

Compact retained maps array more often

When we add maps to the retained maps array, we compacted the array if
it's full. But, since we are now adding maps in a batch, it's unlikely
to meet the condition. Thus, update the condition to check whether new
size exceeds the capacity.

Bug: 398528460
Change-Id: I89caa47b69532c6397596edfe5caf7c7d24768cc
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/6330019
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Commit-Queue: Choongwoo Han <choongwoo.han@microsoft.com>
Cr-Commit-Position: refs/heads/main@{#99163}

Refs: v8/v8@c172ffc

@nodejs-github-bot
Copy link
Collaborator

Review requested:

  • @nodejs/gyp
  • @nodejs/security-wg
  • @nodejs/v8-update

Sorry, something went wrong.

@nodejs-github-bot nodejs-github-bot added build Issues and PRs related to build files or the CI. needs-ci PRs that need a full CI run. v8 engine Issues and PRs related to the V8 dependency. labels Mar 13, 2025
@tunamagur0 tunamagur0 marked this pull request as draft March 13, 2025 09:45
Original commit message:

    Compact retained maps array more often

    When we add maps to the retained maps array, we compacted the array if
    it's full. But, since we are now adding maps in a batch, it's unlikely
    to meet the condition. Thus, update the condition to check whether new
    size exceeds the capacity.

    Bug: 398528460
    Change-Id: I89caa47b69532c6397596edfe5caf7c7d24768cc
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/6330019
    Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
    Commit-Queue: Choongwoo Han <choongwoo.han@microsoft.com>
    Cr-Commit-Position: refs/heads/main@{#99163}

Refs: v8/v8@c172ffc
@tunamagur0 tunamagur0 force-pushed the retained-map-increase branch from 2dd51aa to 282a23e Compare March 13, 2025 09:59
@tunamagur0 tunamagur0 marked this pull request as ready for review March 13, 2025 10:00
@richardlau richardlau added the request-ci Add this label to start a Jenkins CI on a PR. label Mar 14, 2025
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Mar 14, 2025
@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@targos targos added the lts-watch-v22.x PRs that may need to be released in v22.x label Mar 14, 2025
@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@richardlau richardlau added the commit-queue Add this label to land a pull request using GitHub Actions. label Mar 15, 2025
@nodejs-github-bot nodejs-github-bot added commit-queue-failed An error occurred while landing this pull request using GitHub Actions. and removed commit-queue Add this label to land a pull request using GitHub Actions. labels Mar 15, 2025
@nodejs-github-bot
Copy link
Collaborator

Commit Queue failed
- Loading data for nodejs/node/pull/57437
✔  Done loading data for nodejs/node/pull/57437
----------------------------------- PR info ------------------------------------
Title      deps: V8: cherry-pick c172ffc5bf54 (#57437)
   ⚠  Could not retrieve the email or name of the PR author's from user's GitHub profile!
Branch     tunamagur0:retained-map-increase -> nodejs:main
Labels     build, v8 engine, needs-ci, lts-watch-v22.x
Commits    1
 - deps: V8: cherry-pick c172ffc5bf54
Committers 1
 - tunamagur0 <47546832+tunamagur0@users.noreply.github.com>
PR-URL: https://github.com/nodejs/node/pull/57437
Fixes: https://github.com/nodejs/node/issues/57412
Refs: https://github.com/v8/v8/commit/c172ffc5bf54e704558103973e1d5cb7aec491cb
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
------------------------------ Generated metadata ------------------------------
PR-URL: https://github.com/nodejs/node/pull/57437
Fixes: https://github.com/nodejs/node/issues/57412
Refs: https://github.com/v8/v8/commit/c172ffc5bf54e704558103973e1d5cb7aec491cb
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
--------------------------------------------------------------------------------
   ℹ  This PR was created on Thu, 13 Mar 2025 09:42:27 GMT
   ✔  Approvals: 3
   ✔  - Luigi Pinca (@lpinca): https://github.com/nodejs/node/pull/57437#pullrequestreview-2683348686
   ✔  - Michaël Zasso (@targos) (TSC): https://github.com/nodejs/node/pull/57437#pullrequestreview-2684581458
   ✔  - Richard Lau (@richardlau) (TSC): https://github.com/nodejs/node/pull/57437#pullrequestreview-2685912551
   ✘  Last GitHub CI failed
   ℹ  Last Full PR CI on 2025-03-15T00:39:12Z: https://ci.nodejs.org/job/node-test-pull-request/65762/
- Querying data for job/node-test-pull-request/65762/
   ✔  Last Jenkins CI successful
--------------------------------------------------------------------------------
   ✔  Aborted `git node land` session in /home/runner/work/node/node/.ncu
https://github.com/nodejs/node/actions/runs/13871726497

@richardlau richardlau added commit-queue Add this label to land a pull request using GitHub Actions. and removed commit-queue-failed An error occurred while landing this pull request using GitHub Actions. labels Mar 15, 2025
@nodejs-github-bot nodejs-github-bot added commit-queue-failed An error occurred while landing this pull request using GitHub Actions. and removed commit-queue Add this label to land a pull request using GitHub Actions. labels Mar 15, 2025
@nodejs-github-bot
Copy link
Collaborator

Commit Queue failed
- Loading data for nodejs/node/pull/57437
✔  Done loading data for nodejs/node/pull/57437
----------------------------------- PR info ------------------------------------
Title      deps: V8: cherry-pick c172ffc5bf54 (#57437)
Author     tunamagur0 <tsunamaguro3@gmail.com> (@tunamagur0, first-time contributor)
Branch     tunamagur0:retained-map-increase -> nodejs:main
Labels     build, v8 engine, needs-ci, lts-watch-v22.x
Commits    1
 - deps: V8: cherry-pick c172ffc5bf54
Committers 1
 - tunamagur0 <47546832+tunamagur0@users.noreply.github.com>
PR-URL: https://github.com/nodejs/node/pull/57437
Fixes: https://github.com/nodejs/node/issues/57412
Refs: https://github.com/v8/v8/commit/c172ffc5bf54e704558103973e1d5cb7aec491cb
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
------------------------------ Generated metadata ------------------------------
PR-URL: https://github.com/nodejs/node/pull/57437
Fixes: https://github.com/nodejs/node/issues/57412
Refs: https://github.com/v8/v8/commit/c172ffc5bf54e704558103973e1d5cb7aec491cb
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
--------------------------------------------------------------------------------
   ℹ  This PR was created on Thu, 13 Mar 2025 09:42:27 GMT
   ✔  Approvals: 3
   ✔  - Luigi Pinca (@lpinca): https://github.com/nodejs/node/pull/57437#pullrequestreview-2683348686
   ✔  - Michaël Zasso (@targos) (TSC): https://github.com/nodejs/node/pull/57437#pullrequestreview-2684581458
   ✔  - Richard Lau (@richardlau) (TSC): https://github.com/nodejs/node/pull/57437#pullrequestreview-2685912551
   ✘  Last GitHub CI failed
   ℹ  Last Full PR CI on 2025-03-15T09:50:32Z: https://ci.nodejs.org/job/node-test-pull-request/65762/
- Querying data for job/node-test-pull-request/65762/
   ✔  Last Jenkins CI successful
   ⚠  PR author is a new contributor: @tunamagur0(tsunamaguro3@gmail.com)
   ⚠  - commit 282a23e4c16e is authored by choongwoo.han@microsoft.com
--------------------------------------------------------------------------------
   ✔  Aborted `git node land` session in /home/runner/work/node/node/.ncu
https://github.com/nodejs/node/actions/runs/13873396665

@tunamagur0
Copy link
Contributor Author

I'm not very familiar with the system, but could the failure be due to some of the checks being canceled?
https://github.com/nodejs/node/actions/runs/13831866535
https://github.com/nodejs/node/actions/runs/13831866540
https://github.com/nodejs/node/actions/runs/13831866544
https://github.com/nodejs/node/actions/runs/13831866553

@aduh95 aduh95 merged commit dab3f4b into nodejs:main Mar 16, 2025
82 of 85 checks passed
@aduh95
Copy link
Contributor

aduh95 commented Mar 16, 2025

Landed in dab3f4b 2cb1d07 (forced pushed to fix the authorship and please the commit message linter)

aduh95 pushed a commit that referenced this pull request Mar 16, 2025
Original commit message:

    Compact retained maps array more often

    When we add maps to the retained maps array, we compacted the array if
    it's full. But, since we are now adding maps in a batch, it's unlikely
    to meet the condition. Thus, update the condition to check whether new
    size exceeds the capacity.

    Bug: 398528460
    Change-Id: I89caa47b69532c6397596edfe5caf7c7d24768cc
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/6330019
    Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
    Commit-Queue: Choongwoo Han <choongwoo.han@microsoft.com>
    Cr-Commit-Position: refs/heads/main@{#99163}

Refs: v8/v8@c172ffc
PR-URL: #57437
Fixes: #57412
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
Co-Authored-By: tunamagur0
  <47546832+tunamagur0@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build Issues and PRs related to build files or the CI. commit-queue-failed An error occurred while landing this pull request using GitHub Actions. lts-watch-v22.x PRs that may need to be released in v22.x needs-ci PRs that need a full CI run. v8 engine Issues and PRs related to the V8 dependency.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Memory leak due to increasing RetainedMaps size in V8 (Fixed upstream)
7 participants