mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-27 18:12:02 +00:00
add hysteresis of untracked memory
This commit is contained in:
parent
c083896c59
commit
47b45fdc1f
@ -111,7 +111,8 @@ AllocationTrace CurrentMemoryTracker::free(Int64 size)
|
|||||||
if (current_thread)
|
if (current_thread)
|
||||||
{
|
{
|
||||||
current_thread->untracked_memory -= size;
|
current_thread->untracked_memory -= size;
|
||||||
if (current_thread->untracked_memory < -current_thread->untracked_memory_limit)
|
// Note that we use `max_untracked_memory` and not `untracked_memory_limit` to create hysteresis to avoid track/untrack cycles
|
||||||
|
if (current_thread->untracked_memory < -current_thread->max_untracked_memory)
|
||||||
{
|
{
|
||||||
Int64 untracked_memory = current_thread->untracked_memory;
|
Int64 untracked_memory = current_thread->untracked_memory;
|
||||||
current_thread->untracked_memory = 0;
|
current_thread->untracked_memory = 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user