Commit d3a99bc1 authored by Hans Boehm's avatar Hans Boehm
Browse files

Make ArrayDeque clear old array when resizing

ArrayDeques are commonly used for long-lived work queues. If the
queue is resized after the old array has been promoted to the old
GC generation or, in the worst case, has been allocated in a
non-collectable space, everything it referred to remains live
until the old array was collected. This could require a full GC,
or it might never happen.

We now avoid this problem by explicitly clearing the old array
before dropping it.

Bug: 116365212
Bug: 113624968
Bug: 130206915

Test: Boot AOSP, TreeHugger
Merged-In: I614a514180e04440e1d59d69a9b249e5c3db485e
Change-Id: I614a514180e04440e1d59d69a9b249e5c3db485e
(cherry picked from commit 7e1393d1565c76abdd4e667477914cc0562427be)
parent bfb34cd4
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment