Skip to content

Commit 7f5a9f3

Browse files
authored
Fix build for memory profiling mode (#12569)
1 parent d78c86c commit 7f5a9f3

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

ydb/core/memory_controller/memory_controller.cpp

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#include "memory_controller.h"
22
#include "memory_controller_config.h"
33
#include "memtable_collection.h"
4-
#include <util/stream/format.h>
4+
55
#include <ydb/core/base/counters.h>
66
#include <ydb/core/base/localdb.h>
77
#include <ydb/core/base/memory_controller_iface.h>
@@ -11,16 +11,21 @@
1111
#include <ydb/core/node_whiteboard/node_whiteboard.h>
1212
#include <ydb/core/protos/memory_controller_config.pb.h>
1313
#include <ydb/core/protos/memory_stats.pb.h>
14-
#include <ydb/core/tablet/resource_broker.h>
1514
#include <ydb/core/tablet_flat/shared_sausagecache.h>
15+
#include <ydb/core/tablet/resource_broker.h>
1616
#include <ydb/library/actors/core/actor_bootstrapped.h>
1717
#include <ydb/library/actors/core/log.h>
1818
#include <ydb/library/actors/core/process_stats.h>
1919
#include <ydb/library/services/services.pb.h>
2020
#include <yql/essentials/minikql/aligned_page_pool.h>
21+
#include <yql/essentials/public/udf/arrow/memory_pool.h>
22+
2123
#include <contrib/libs/apache/arrow/cpp/src/arrow/type.h>
2224
#include <contrib/libs/apache/arrow/cpp/src/arrow/memory_pool.h>
23-
#include <yql/essentials/public/udf/arrow/memory_pool.h>
25+
26+
#include <util/stream/format.h>
27+
28+
#include <tcmalloc/malloc_extension.h>
2429

2530
namespace NKikimr::NMemory {
2631

@@ -128,6 +133,10 @@ class TMemoryController : public TActorBootstrapped<TMemoryController> {
128133

129134
// When profiling memory it's convenient to set initial tcmalloc soft limit
130135
#ifdef PROFILE_MEMORY_ALLOCATIONS
136+
auto processMemoryInfo = ProcessMemoryInfoProvider->Get();
137+
bool hasMemTotalHardLimit = false;
138+
ui64 hardLimitBytes = GetHardLimitBytes(Config, processMemoryInfo, hasMemTotalHardLimit);
139+
131140
tcmalloc::MallocExtension::MemoryLimit limit;
132141
limit.hard = false;
133142
limit.limit = GetSoftLimitBytes(Config, hardLimitBytes);

0 commit comments

Comments
 (0)