Files
scylladb/utils
Michał Chojnowski 85048b349b memtable: fix accounting of managed_bytes in partition_snapshot_accounter
managed_bytes has a small overhead per each fragment. Due to that, managed_bytes
containing the same data can have different total memory usage in different
allocators. The smaller the preferred max allocation size setting is, the more
fragments are needed and the greater total per-fragment overhead is.
In particular, managed_bytes allocated in the LSA could grow in
memory usage when copied to the standard allocator, if the standard allocator
had a preferred max allocation setting smaller than the LSA.

partition_snapshot_accounter calculates the amount of memory used by
mutation fragments in the memtable (where they are allocated with LSA) based
on the memory usage after they are copied to the standard allocator.
This could result in an overestimation, as explained above.
But partition_snapshot_accounter must not overestimate the amount of freed
memory, as doing otherwise might result in OOM situations.

This patch prevents the overaccounting by adding minimal_external_memory_usage():
a new version of external_memory_usage(), which ignores allocator-dependent
overhead. In particular, it includes the per-fragment overhead in managed_bytes
only once, no matter how many fragments there are.
2021-01-15 18:21:13 +01:00
..
2020-01-30 14:10:18 +02:00
2020-03-23 11:59:30 +02:00
2020-08-03 15:55:16 +03:00
2020-10-13 12:32:14 +03:00
2020-10-13 12:32:14 +03:00
2020-08-04 17:54:45 +03:00
2020-10-18 18:16:30 +03:00
2020-03-23 11:59:30 +02:00
2020-08-11 19:37:47 +08:00
2020-01-26 18:54:36 +02:00