-
-
Notifications
You must be signed in to change notification settings - Fork 31.7k
Memory leak due to increasing RetainedMaps size in V8 (Fixed upstream) #57412
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
Comments
That's amazing! Could you please send us your patch? This https://github.com/nodejs/node/blob/main/doc/contributing/maintaining/maintaining-V8.md may be handy |
@juanarbol |
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 <[email protected]> Commit-Queue: Choongwoo Han <[email protected]> Cr-Commit-Position: refs/heads/main@{#99163} Refs: v8/v8@c172ffc PR-URL: #57437 Fixes: #57412 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Richard Lau <[email protected]> Co-Authored-By: tunamagur0 <[email protected]>
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 <[email protected]> Commit-Queue: Choongwoo Han <[email protected]> Cr-Commit-Position: refs/heads/main@{#99163} Refs: v8/v8@c172ffc PR-URL: #57437 Fixes: #57412 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Richard Lau <[email protected]> Co-Authored-By: tunamagur0 <[email protected]>
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 <[email protected]> Commit-Queue: Choongwoo Han <[email protected]> Cr-Commit-Position: refs/heads/main@{#99163} Refs: v8/v8@c172ffc PR-URL: nodejs#57437 Fixes: nodejs#57412 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Richard Lau <[email protected]> Co-Authored-By: tunamagur0 <[email protected]>
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 <[email protected]> Commit-Queue: Choongwoo Han <[email protected]> Cr-Commit-Position: refs/heads/main@{#99163} Refs: v8/v8@c172ffc PR-URL: nodejs#57437 Fixes: nodejs#57412 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Richard Lau <[email protected]> Co-Authored-By: tunamagur0 <[email protected]>
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 <[email protected]> Commit-Queue: Choongwoo Han <[email protected]> Cr-Commit-Position: refs/heads/main@{#99163} Refs: v8/v8@c172ffc PR-URL: nodejs#57437 Fixes: nodejs#57412 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Richard Lau <[email protected]> Co-Authored-By: tunamagur0 <[email protected]>
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 <[email protected]> Commit-Queue: Choongwoo Han <[email protected]> Cr-Commit-Position: refs/heads/main@{#99163} Refs: v8/v8@c172ffc PR-URL: nodejs#57437 Fixes: nodejs#57412 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Richard Lau <[email protected]> Co-Authored-By: tunamagur0 <[email protected]>
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 <[email protected]> Commit-Queue: Choongwoo Han <[email protected]> Cr-Commit-Position: refs/heads/main@{#99163} Refs: v8/v8@c172ffc PR-URL: #57437 Fixes: #57412 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Richard Lau <[email protected]> Co-Authored-By: tunamagur0 <[email protected]>
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 <[email protected]> Commit-Queue: Choongwoo Han <[email protected]> Cr-Commit-Position: refs/heads/main@{#99163} Refs: v8/v8@c172ffc PR-URL: #57437 Fixes: #57412 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Richard Lau <[email protected]> Co-Authored-By: tunamagur0 <[email protected]>
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 <[email protected]> Commit-Queue: Choongwoo Han <[email protected]> Cr-Commit-Position: refs/heads/main@{#99163} Refs: v8/v8@c172ffc PR-URL: nodejs#57437 Fixes: nodejs#57412 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Richard Lau <[email protected]> Co-Authored-By: tunamagur0 <[email protected]>
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 <[email protected]> Commit-Queue: Choongwoo Han <[email protected]> Cr-Commit-Position: refs/heads/main@{#99163} Refs: v8/v8@c172ffc PR-URL: nodejs#57437 Fixes: nodejs#57412 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Richard Lau <[email protected]> Co-Authored-By: tunamagur0 <[email protected]>
Was this ever cherry-picked into the 22.x series? I don't see anything in the changelog indicating that it was... |
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 <[email protected]> Commit-Queue: Choongwoo Han <[email protected]> Cr-Commit-Position: refs/heads/main@{#99163} Refs: v8/v8@c172ffc PR-URL: nodejs#57437 Fixes: nodejs#57412 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Richard Lau <[email protected]> Co-Authored-By: tunamagur0 <[email protected]>
I think this will be released in the next version. |
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 <[email protected]> Commit-Queue: Choongwoo Han <[email protected]> Cr-Commit-Position: refs/heads/main@{#99163} Refs: v8/v8@c172ffc PR-URL: #57437 Fixes: #57412 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Richard Lau <[email protected]> Co-Authored-By: tunamagur0 <[email protected]>
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 <[email protected]> Commit-Queue: Choongwoo Han <[email protected]> Cr-Commit-Position: refs/heads/main@{#99163} Refs: v8/v8@c172ffc PR-URL: #57437 Fixes: #57412 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Richard Lau <[email protected]> Co-Authored-By: tunamagur0 <[email protected]>
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 <[email protected]> Commit-Queue: Choongwoo Han <[email protected]> Cr-Commit-Position: refs/heads/main@{#99163} Refs: v8/v8@c172ffc PR-URL: #57437 Fixes: #57412 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Richard Lau <[email protected]> Co-Authored-By: tunamagur0 <[email protected]>
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 <[email protected]> Commit-Queue: Choongwoo Han <[email protected]> Cr-Commit-Position: refs/heads/main@{#99163} Refs: v8/v8@c172ffc PR-URL: #57437 Fixes: #57412 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Richard Lau <[email protected]> Co-Authored-By: tunamagur0 <[email protected]>
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 <[email protected]> Commit-Queue: Choongwoo Han <[email protected]> Cr-Commit-Position: refs/heads/main@{#99163} Refs: v8/v8@c172ffc PR-URL: #57437 Fixes: #57412 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Richard Lau <[email protected]> Co-Authored-By: tunamagur0 <[email protected]>
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 <[email protected]> Commit-Queue: Choongwoo Han <[email protected]> Cr-Commit-Position: refs/heads/main@{#99163} Refs: v8/v8@c172ffc PR-URL: #57437 Fixes: #57412 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Richard Lau <[email protected]> Co-Authored-By: tunamagur0 <[email protected]>
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 <[email protected]> Commit-Queue: Choongwoo Han <[email protected]> Cr-Commit-Position: refs/heads/main@{#99163} Refs: v8/v8@c172ffc PR-URL: #57437 Fixes: #57412 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Richard Lau <[email protected]> Co-Authored-By: tunamagur0 <[email protected]>
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 <[email protected]> Commit-Queue: Choongwoo Han <[email protected]> Cr-Commit-Position: refs/heads/main@{#99163} Refs: v8/v8@c172ffc PR-URL: #57437 Fixes: #57412 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Richard Lau <[email protected]> Co-Authored-By: tunamagur0 <[email protected]>
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 <[email protected]> Commit-Queue: Choongwoo Han <[email protected]> Cr-Commit-Position: refs/heads/main@{#99163} Refs: v8/v8@c172ffc PR-URL: #57437 Fixes: #57412 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Richard Lau <[email protected]> Co-Authored-By: tunamagur0 <[email protected]>
Version
v22.14.0
Platform
Subsystem
v8
What steps will reproduce the bug?
--expose-gc
.(system) > system / NativeContext > retained_maps :: system / WeakArrayList
Note:
The increase is gradual, so it may take several hours to see a significant difference.
However, even within a shorter period, a steady increase should still be observable.
How often does it reproduce? Is there a required condition?
It reproduces consistently.
What is the expected behavior? Why is that the expected behavior?
RetainedMaps size should remain stable over time.
What do you see instead?
Eventually, this could result in performance degradation or excessive memory usage.
Below are screenshots showing the memory usage:
v22.14.0
v22.14.0 (with the patch applied)
Additional information
e5a29df7b41416de67730d2968c61745b54be66c
V8 Issue 398528460
The text was updated successfully, but these errors were encountered: