DescriptionAvoid scanning huge freelists for large enough free blocks.
The current old-space allocation implementation performs a
linear search in a single (potentially *very long*) free list for
allocations > 2k.
This CL will change this behavior to limit the number of free list
entries traversed, falling back to allocate a new page if the maximum
number of steps was reached. The new page will be pushed onto the
front of the free list, therefore making new allocations go there
immediately.
For the new tests/standalone/fragmentation_test.dart we
- pay around 11-12% increase in memory
- to gain a 6x speedup (125x speedup with sweepers disabled)
I tried a much more complicated version that had power-of-two
buckets for freelist items > 2k. This turned out to regress
dart2js and splay for reasons that I could not determine. This
version is much simpler and fixes the issue as observed in the
bug.
Closes #29588
R=kustermann@google.com
Committed: https://github.com/dart-lang/sdk/commit/37b320d38133344a69555377155e0e390b434d9c
Patch Set 1 #Patch Set 2 : Only trigger if issue persists for a while #Patch Set 3 : Fix small thinko #Patch Set 4 : Rename test file #
Total comments: 6
Patch Set 5 : Feedback from Martin #
Messages
Total messages: 8 (5 generated)
|