You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thread caches (tcaches) serve well for amortizing mutex overhead, but they do not provide adequate hysteresis for applications with large short-term swings in usage unless tcache size is dynamic. Dynamic tcache sizing introduces a whole extra set of issues though, because the total amount of memory dedicated to tcaches needs to be limited (even though there can be many extant threads), thus requiring some sort of centralized tcache sizing logic, yet tcaches want to operate independently. Furthermore, dynamically sized tcaches still don't address all common usage patterns; in particular they perform poorly for applications which produce (allocate) memory in one thread and consume (process and then deallocate) memory in other threads.
Dynamically sized per arena caches (acaches) are easier to size because the number of extant arenas tends to be fixed at a relatively low number. Furthermore, producer/consumer usage patterns can be satisfied by acache without any special effort.
Like tcaches, acaches should support manual flushing, e.g. via a arena.<i>.flushmallctl. Details of how to dynamically size acaches remain to be worked out.
our use-case is with a pub-sub framework called rocketspeed that typically allocates a msg on one thread and frees it on another thread. It would be great if we can have a memory pool per cpu rather than per thread.
Activity
dhruba commentedon Jul 16, 2015
our use-case is with a pub-sub framework called rocketspeed that typically allocates a msg on one thread and frees it on another thread. It would be great if we can have a memory pool per cpu rather than per thread.
interwq commentedon Jul 1, 2016
A version of implementation here: interwq@ff4c5fb
Will add GC, stats next.
interwq commentedon Apr 3, 2019
@djwatson has page cache in #1455.