mirror of
https://github.com/scylladb/scylladb.git
synced 2026-04-26 11:30:36 +00:00
Set up a coroutine in a new scheduling group to ensure there is a "cushion" of free memory. It reclaims in preemptible mode in order to reduce reactor stalls (constrast with synchronous reclaim that cannot preempt until it achieved its goal). The free memory target is arbitrarily set at 60MB. The reclaimer's shares are proportional to the distance from the free memory target; so a workload that allocates memory rapidly will have the background reclaimer working harder. I rolled my own condition variable here, mostly as an experiment. seastar::condition_variable requires several allocations, while the one here requires none. We should formalize it after we gain more experience with it.
29 KiB
29 KiB