• Benoit Lize's avatar
    [PartitionAlloc] Trigger all-thread Purge() from any thread. · 3543808c
    Benoit Lize authored
    Thread caches can accumulate memory over time, increasing memory
    footprint. It is then necessary to Purge() them to avoid this. However
    thread caches are meant to be thread-unsafe and not use locking on the
    fast path, so they cannot be purged from another thread.
    
    This adds a mechanism to purge all thread caches, by synchronously
    purging the current thread, and asking other threads to Purge() at the
    next deallocation. This does not solve the problem of a thread sleeping
    and never deallocating, which will be addressed later.
    
    Bug: 998048
    Change-Id: I82c70be128acf2e0801623e81c353bdbc80231a2
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2428985
    Commit-Queue: Benoit L <lizeb@chromium.org>
    Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#810650}
    3543808c
partition_alloc.cc 35.4 KB