Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(84)

Issue 1005083004: Avoid infinite growth of linked hash map implementation (Closed)

Created:
5 years, 9 months ago by kustermann
Modified:
5 years, 9 months ago
Reviewers:
koda, Ivan Posva
CC:
reviews_dartlang.org, vm-dev_dartlang.org
Target Ref:
refs/remotes/git-svn
Visibility:
Public.

Description

Avoid infinite growth of linked hash map implementation R=iposva@google.com, koda@google.com Committed: https://code.google.com/p/dart/source/detail?r=44671

Patch Set 1 #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+29 lines, -29 lines) Patch
M dart/runtime/lib/compact_hash.dart View 19 chunks +29 lines, -29 lines 2 comments Download

Messages

Total messages: 7 (2 generated)
kustermann
The set implementation should be correct.
5 years, 9 months ago (2015-03-24 16:14:33 UTC) #2
Ivan Posva
LGTM -ip
5 years, 9 months ago (2015-03-24 16:24:38 UTC) #4
koda
LGTM, thanks. We should have a test will lots of repeated add/delete. I can add ...
5 years, 9 months ago (2015-03-24 16:27:57 UTC) #5
kustermann
Committed patchset #1 (id:1) manually as 44671 (presubmit successful).
5 years, 9 months ago (2015-03-24 16:32:39 UTC) #6
kustermann
5 years, 9 months ago (2015-03-24 16:44:01 UTC) #7
Message was sent while issue was closed.
https://codereview.chromium.org/1005083004/diff/1/dart/runtime/lib/compact_ha...
File dart/runtime/lib/compact_hash.dart (right):

https://codereview.chromium.org/1005083004/diff/1/dart/runtime/lib/compact_ha...
dart/runtime/lib/compact_hash.dart:98: if ((_deletedKeys << 2) > _usedData) {
On 2015/03/24 16:27:57, koda wrote:
> Perhaps expressing this in terms of 'length' instead would have made the bug
> easier to spot:
> 
> if (_deletedKeys > length)
> ...
Good point. Ivan wanted me to submit the CL as is -  sorry for not addressing
the comment - in order to get it cherry-picked to dev channel.

If you'll add a test, I guess you can rename it to length.

You could use the VMOptions setting from our test runner to reduce old space
size. i.e. something like:

$ cat tests/standalone/map_literal_oom_test.dart
// VMOptions=--old_gen_heap_size=10

main() {
  var x = {};
  for (int i = 0; i < 1000000000; i++) {
    x[i] = 10;
    x.remove(i);
  }
}

Powered by Google App Engine
This is Rietveld 408576698