Allow opt.tcache_max to accept small size classes.

Previously all the small size classes were cached.  However this has downsides
-- particularly when page size is greater than 4K (e.g. iOS), which will result
in much higher SMALL_MAXCLASS.

This change allows tcache_max to be set to lower values, to better control
resources taken by tcache.
This commit is contained in:
Qi Wang
2020-10-21 19:47:57 -07:00
committed by Qi Wang
parent ea32060f9c
commit bf72188f80
10 changed files with 265 additions and 33 deletions

View File

@@ -1313,7 +1313,7 @@ malloc_conf = "xmalloc:true";]]></programlisting>
<literal>r-</literal>
</term>
<listitem><para>Maximum size class to cache in the thread-specific cache
(tcache). At a minimum, all small size classes are cached; and at a
(tcache). At a minimum, the first size class is cached; and at a
maximum, size classes up to 8 MiB can be cached. The default maximum is
32 KiB (2^15). As a convenience, this may also be set by specifying
lg_tcache_max, which will be taken to be the base-2 logarithm of the