16149782ef
When the heap limit is reached, directly unreachable objects are reclaimed but objects that will be unreachable after a finalization are not, and there needs to be enough headroom between opportunities for finalizers to run (returning to the event loop). So only do the finalization thing with the upper, high-mutation part of the splay tree and remove it from the lower, write-once part. The high-mutation part is what's more interesting for GC stress testing. Bug: https://github.com/dart-lang/sdk/issues/50597 Change-Id: Id02b38b0ac1e9bb640954ef1b686ce3eef8370af Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/273300 Reviewed-by: Daco Harkes <dacoharkes@google.com> Commit-Queue: Ryan Macnak <rmacnak@google.com>