mirror of
https://github.com/jemalloc/jemalloc.git
synced 2026-08-05 01:46:16 +03:00
parent
ced8b3cffb
commit
2114349a4e
30 changed files with 124 additions and 1364 deletions
|
|
@ -3,26 +3,8 @@
|
|||
|
||||
#include "jemalloc/internal/bin_info.h"
|
||||
|
||||
/*
|
||||
* We leave bin-batching disabled by default, with other settings chosen mostly
|
||||
* empirically; across the test programs I looked at they provided the most bang
|
||||
* for the buck. With other default settings, these choices for bin batching
|
||||
* result in them consuming far less memory (even in the worst case) than the
|
||||
* tcaches themselves, the arena, etc.
|
||||
* Note that we always try to pop all bins on every arena cache bin lock
|
||||
* operation, so the typical memory waste is far less than this (and only on
|
||||
* hot bins, which tend to be large anyways).
|
||||
*/
|
||||
size_t opt_bin_info_max_batched_size = 0; /* 192 is a good default. */
|
||||
size_t opt_bin_info_remote_free_max_batch = 4;
|
||||
size_t opt_bin_info_remote_free_max = BIN_REMOTE_FREE_ELEMS_MAX;
|
||||
|
||||
bin_info_t bin_infos[SC_NBINS];
|
||||
|
||||
szind_t bin_info_nbatched_sizes;
|
||||
unsigned bin_info_nbatched_bins;
|
||||
unsigned bin_info_nunbatched_bins;
|
||||
|
||||
static void
|
||||
bin_infos_init(sc_data_t *sc_data, unsigned bin_shard_sizes[SC_NBINS],
|
||||
bin_info_t infos[SC_NBINS]) {
|
||||
|
|
@ -38,12 +20,6 @@ bin_infos_init(sc_data_t *sc_data, unsigned bin_shard_sizes[SC_NBINS],
|
|||
bitmap_info_t bitmap_info = BITMAP_INFO_INITIALIZER(
|
||||
bin_info->nregs);
|
||||
bin_info->bitmap_info = bitmap_info;
|
||||
if (bin_info->reg_size <= opt_bin_info_max_batched_size) {
|
||||
bin_info_nbatched_sizes++;
|
||||
bin_info_nbatched_bins += bin_info->n_shards;
|
||||
} else {
|
||||
bin_info_nunbatched_bins += bin_info->n_shards;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue