ClickHouse/programs
Azat Khuzhin 72d7b6117e Use total_memory_tracker when there is no other MemoryTracker object.
This should significantly reduce the MemoryTracking drift, test shows
that there is 0 drift after query storm (100 queries, via http/tcp/tcp
in one session).

TL;DR;

To track memory, clickhouse creates memory tracker object for each
thread **explicitly**, but until it is not created the memory
allocations are not under account.
There should not be lot of allocations w/o memory tracker, since most of
the time it is created early enough, but even this maybe enough to
trigger some problems.

Plus sometimes it is not possible to create it, for example some 3d
party library does not allow to do this explicitly:
- for example before #15740 allocations from librdkafka threads,
- or even worse, poco threads, they don't have any routines to do this.
This won't be a problem for `MemoryTracking` metric if the deallocation
will be done from the same thread w/o memory tracker (or vise versa),
but this is not always true.

NOTE, that this will slow down per-thread allocations w/o memory
tracker, since before this patch there were no memory tracking for them
while now they will be accounted in total_memory_tracker, and for
total_memory_tracker max_untracked_memory is always reached.
But this should not be significant.
2020-10-23 21:07:52 +03:00
..
benchmark Secure inter-cluster query execution (with initial_user as current query user) [v3] 2020-09-15 01:36:28 +03:00
client reset error code in ast fuzzer 2020-10-16 17:27:47 +03:00
compressor added sub-tables in report, replaced some USE_ -> ENABLE_ for 2020-09-18 16:09:22 +03:00
copier Update Internals.cpp 2020-10-10 02:31:33 +03:00
extract-from-config Refactor CMake build files (#11390) 2020-06-09 13:54:49 +03:00
format Add missing dependencies 2020-09-26 04:59:25 +03:00
git-import Merge branch 'git-to-clickhouse' of github.com:yandex/ClickHouse into git-to-clickhouse 2020-09-12 03:56:13 +03:00
install Set capabilities with caution 2020-10-20 21:09:15 +03:00
local Apply suggestions from code review 2020-10-22 20:46:17 +03:00
obfuscator Uint128 logic and tests 2020-09-06 00:35:24 +03:00
odbc-bridge added sub-tables in report, replaced some USE_ -> ENABLE_ for 2020-09-18 16:09:22 +03:00
server Use total_memory_tracker when there is no other MemoryTracker object. 2020-10-23 21:07:52 +03:00
clickhouse-split-helper Move all folders inside /dbms one level up (#9974) 2020-04-02 02:51:21 +03:00
CMakeLists.txt moved the generators to docs/ folder 2020-09-19 19:42:36 +03:00
config_tools.h.in Add git-import as a tool 2020-09-07 06:22:47 +03:00
main.cpp Update main.cpp 2020-10-05 09:28:52 +03:00
ya.make Fix "Arcadia" 2020-09-08 01:14:13 +03:00