mirror of
https://github.com/jemalloc/jemalloc.git
synced 2026-07-26 18:47:19 +03:00
Add a per-arena oversize_threshold.
This can let manual arenas trade off memory and CPU the way auto arenas do.
This commit is contained in:
parent
4ca3d91e96
commit
cf2549a149
10 changed files with 194 additions and 12 deletions
|
|
@ -983,8 +983,9 @@ extent_record(tsdn_t *tsdn, pac_t *pac, ehooks_t *ehooks,
|
|||
edata = extent_try_coalesce_large(tsdn, pac, ehooks,
|
||||
ecache, edata, &coalesced, growing_retained);
|
||||
} while (coalesced);
|
||||
if (edata_size_get(edata) >= oversize_threshold &&
|
||||
extent_may_force_decay(pac)) {
|
||||
if (edata_size_get(edata) >=
|
||||
atomic_load_zu(&pac->oversize_threshold, ATOMIC_RELAXED)
|
||||
&& extent_may_force_decay(pac)) {
|
||||
/* Shortcut to purge the oversize extent eagerly. */
|
||||
malloc_mutex_unlock(tsdn, &ecache->mtx);
|
||||
extent_maximally_purge(tsdn, pac, ehooks, edata);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue