Skip to content

Conversation

@ofrobots
Copy link
Contributor

@ofrobotsofrobots commented Apr 26, 2016

Checklist
  • tests and code linting passes
  • the commit message follows commit guidelines
Affected core subsystem(s)

deps

Description of change

Original commit messages:
v8/v8@e093a04

Rehash and clear deleted entries in weak collections during GC
Otherwise, they'll just keep growing until we run out of memory or hit the FixedArray's maximum capacity.

BUG=v8:4909
R=[email protected]
LOG=n

Review URL: https://codereview.chromium.org/1877233005

Cr-Commit-Position: refs/heads/master@{#35514}

v8/v8@09db540

Reland of Rehash and clear deleted entries in weak collections during GC
BUG=v8:4909
R=[email protected],[email protected]
LOG=n

Review URL: https://codereview.chromium.org/1890123002

Cr-Commit-Position: refs/heads/master@{#35538}

V8-Bug: https://crbug.com/v8/4909
Fixes: #6180
Ref: #6375
R=@nodejs/v8
CI: https://ci.nodejs.org/job/node-test-pull-request/2399/

Original commit messages: v8/v8@e093a04 Rehash and clear deleted entries in weak collections during GC Otherwise, they'll just keep growing until we run out of memory or hit the FixedArray's maximum capacity. BUG=v8:4909 [email protected] LOG=n Review URL: https://codereview.chromium.org/1877233005 Cr-Commit-Position: refs/heads/master@{nodejs#35514} v8/v8@09db540 Reland of Rehash and clear deleted entries in weak collections during GC BUG=v8:4909 [email protected],[email protected] LOG=n Review URL: https://codereview.chromium.org/1890123002 Cr-Commit-Position: refs/heads/master@{nodejs#35538} V8-Bug: https://crbug.com/v8/4909Fixes: nodejs#6180
@ofrobotsofrobots added v8 engine Issues and PRs related to the V8 dependency. lts-watch-v4.x labels Apr 26, 2016
@indutny
Copy link
Member

Rubber-stamp LGTM

@Fishrock123Fishrock123 modified the milestone: 6.0.0Apr 26, 2016
table->RemoveEntry(i);
}
}
// Rehash if more than 25% of the entries are deleted entries.
Copy link
Member

Choose a reason for hiding this comment

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

More than 50%, I think?

Copy link
Contributor

Choose a reason for hiding this comment

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

actually, it's 1/3, but in any case the comment is wrong

@bnoordhuis
Copy link
Member

LGTM

@ChALkeR
Copy link
Member

ChALkeR commented Apr 26, 2016

Does this solve the testcase at #6375 (comment)?
I am not able to test that atm.
Note: this is just a question, it should not hold this PR.

@jasnell
Copy link
Member

Should this go into v6?

@ChALkeR
Copy link
Member

@jasnell I think that's the reason for backporting, isn't it?

@ChALkeRChALkeR added the memory Issues and PRs related to the memory management or memory footprint. label Apr 26, 2016
@ofrobots
Copy link
ContributorAuthor

This can go in a patch level, no need to hold the release for this.
On Apr 26, 2016 8:52 AM, "Сковорода Никита Андреевич" <
[email protected]> wrote:

@jasnellhttps://github.com/jasnell I think that's the reason for
backporting, isn't it?


You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub
#6398 (comment)

@jasnell
Copy link
Member

Ok. LGTM btw

if ((table->NumberOfDeletedElements() << kJSWeakCollectionLoadFactorExp) >
table->NumberOfElements()){
HandleScope scope(heap()->isolate());
table->Rehash(heap()->isolate()->factory()->undefined_value());
Copy link
Contributor

Choose a reason for hiding this comment

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

@ofrobots this is the wrong CL, you should only merge the "Reland" CL.

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

@jeisinger: Applying the two patches from the 'Reland CL' (https://codereview.chromium.org/1890123002/#ps20001) produces the same patch as 3e8d7a7. Maybe I am missing something?

/cc @matthewloring re: #7883

@ChALkeR
Copy link
Member

Btw, @jeisinger, @natorion, what about back-porting this to v8 5.0.x?

@natorion
Copy link

Could you please use the process outlined in https://github.com/v8/v8/wiki/Merging%20&%20Patching ?

@ofrobots
Copy link
ContributorAuthor

Superceded by #6572. I will open a separate PR to backport the relevant commits to v4.x.

@ofrobots
Copy link
ContributorAuthor

Upon verification, the upstream fixes are not sufficient for solving the original issue in #6180. Closing this PR. Let's wait until https://crbug.com/v8/4909 gets fully resolved.

fhinkel added a commit to v8/node that referenced this pull request Jun 28, 2017
@ofrobotsofrobots deleted the fix-6180-master branch July 21, 2017 14:27
abernix added a commit to abernix/node that referenced this pull request Aug 14, 2017
Original commit messages: v8/v8@09db540 Reland of Rehash and clear deleted entries in weak collections during GC BUG=v8:4909 [email protected],[email protected] LOG=n Review URL: https://codereview.chromium.org/1890123002 Cr-Commit-Position: refs/heads/master@{nodejs#35538} v8/v8@686558d Fix comment about when we rehash ObjectHashTables before growing them [email protected] BUG= Review-Url: https://codereview.chromium.org/1918403003 Cr-Commit-Position: refs/heads/master@{nodejs#35853} Refs: https://crbug.com/v8/4909 Refs: nodejs#6180 Refs: nodejs#7689 Refs: nodejs#6398Fixes: nodejs#14228
MylesBorins pushed a commit that referenced this pull request Aug 16, 2017
Original commit messages: v8/v8@09db540 Reland of Rehash and clear deleted entries in weak collections during GC BUG=v8:4909[email protected],[email protected] LOG=n Review URL: https://codereview.chromium.org/1890123002 Cr-Commit-Position: refs/heads/master@{#35538} v8/v8@686558d Fix comment about when we rehash ObjectHashTables before growing them [email protected] BUG= Review-Url: https://codereview.chromium.org/1918403003 Cr-Commit-Position: refs/heads/master@{#35853} Refs: https://crbug.com/v8/4909 Refs: #6180 Refs: #7689 Refs: #6398Fixes: #14228 PR-URL: #14829 Reviewed-By: Ben Noordhuis <[email protected]>
MylesBorins pushed a commit that referenced this pull request Oct 25, 2017
Original commit messages: v8/v8@09db540 Reland of Rehash and clear deleted entries in weak collections during GC BUG=v8:4909[email protected],[email protected] LOG=n Review URL: https://codereview.chromium.org/1890123002 Cr-Commit-Position: refs/heads/master@{#35538} v8/v8@686558d Fix comment about when we rehash ObjectHashTables before growing them [email protected] BUG= Review-Url: https://codereview.chromium.org/1918403003 Cr-Commit-Position: refs/heads/master@{#35853} Refs: https://crbug.com/v8/4909 Refs: #6180 Refs: #7689 Refs: #6398Fixes: #14228 PR-URL: #14829 Reviewed-By: Ben Noordhuis <[email protected]>
gibfahn pushed a commit to ibmruntimes/node that referenced this pull request Nov 24, 2017
Original commit messages: v8/v8@09db540 Reland of Rehash and clear deleted entries in weak collections during GC BUG=v8:4909 [email protected],[email protected] LOG=n Review URL: https://codereview.chromium.org/1890123002 Cr-Commit-Position: refs/heads/master@{#35538} v8/v8@686558d Fix comment about when we rehash ObjectHashTables before growing them [email protected] BUG= Review-Url: https://codereview.chromium.org/1918403003 Cr-Commit-Position: refs/heads/master@{#35853} Refs: https://crbug.com/v8/4909 Refs: nodejs/node#6180 Refs: nodejs/node#7689 Refs: nodejs/node#6398Fixes: nodejs/node#14228 PR-URL: nodejs/node#14829 Reviewed-By: Ben Noordhuis <[email protected]>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

memoryIssues and PRs related to the memory management or memory footprint.v8 engineIssues and PRs related to the V8 dependency.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Memory leak in simple test case involving WeakSet

9 participants

@ofrobots@indutny@bnoordhuis@ChALkeR@jasnell@natorion@jeisinger@MylesBorins@Fishrock123