MCPcopy Create free account
hub / github.com/ClickHouse/ClickHouse / getNumaNodesTotalMemory

Function getNumaNodesTotalMemory

base/base/Numa.cpp:12–35  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

10{
11
12std::optional<size_t> getNumaNodesTotalMemory()
13{
14 std::optional<size_t> total_memory;
15#if USE_NUMACTL
16 if (numa_available() != -1)
17 {
18 auto * membind = numa_get_membind();
19 if (!numa_bitmask_equal(membind, numa_all_nodes_ptr))
20 {
21 total_memory.emplace(0);
22 auto max_node = numa_max_node();
23 for (int i = 0; i <= max_node; ++i)
24 {
25 if (numa_bitmask_isbitset(membind, i))
26 *total_memory += numa_node_size(i, nullptr);
27 }
28 }
29
30 numa_bitmask_free(membind);
31 }
32
33#endif
34 return total_memory;
35}
36
37}

Callers 3

getMemoryAmountOrZeroFunction · 0.85
mainMethod · 0.85
mainMethod · 0.85

Calls 1

emplaceMethod · 0.45

Tested by

no test coverage detected