Skip to content

Commit 5b61f0c

Browse files
authored
Always limit HardLimitBytes with MemTotal (#8223)
1 parent 60e276b commit 5b61f0c

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

ydb/core/memory_controller/memory_controller_config.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,15 @@ inline ui64 GetHardLimitBytes(const NKikimrConfig::TMemoryControllerConfig& conf
5353
if (info.CGroupLimit.has_value()) {
5454
hardLimitBytes = Min(hardLimitBytes, info.CGroupLimit.value());
5555
}
56+
if (info.MemTotal.has_value()) {
57+
hardLimitBytes = Min(hardLimitBytes, info.MemTotal.value());
58+
}
5659
return hardLimitBytes;
5760
}
5861
if (info.CGroupLimit.has_value()) {
5962
return info.CGroupLimit.value();
6063
}
61-
if (info.MemTotal) {
64+
if (info.MemTotal.has_value()) {
6265
hasMemTotalHardLimit = true;
6366
return info.MemTotal.value();
6467
}

0 commit comments

Comments
 (0)