mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-09 17:14:47 +00:00
Fix non-linux build
This commit is contained in:
parent
9d92bcff46
commit
04d80ec276
@ -33,7 +33,6 @@ namespace ErrorCodes
|
|||||||
extern const int LOGICAL_ERROR;
|
extern const int LOGICAL_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(OS_LINUX)
|
|
||||||
struct ICgroupsReader
|
struct ICgroupsReader
|
||||||
{
|
{
|
||||||
virtual ~ICgroupsReader() = default;
|
virtual ~ICgroupsReader() = default;
|
||||||
@ -44,6 +43,7 @@ struct ICgroupsReader
|
|||||||
namespace
|
namespace
|
||||||
{
|
{
|
||||||
|
|
||||||
|
#if defined(OS_LINUX)
|
||||||
/// Format is
|
/// Format is
|
||||||
/// kernel 5
|
/// kernel 5
|
||||||
/// rss 15
|
/// rss 15
|
||||||
@ -269,7 +269,7 @@ uint64_t MemoryWorker::getMemoryUsage()
|
|||||||
switch (source)
|
switch (source)
|
||||||
{
|
{
|
||||||
case MemoryUsageSource::Cgroups:
|
case MemoryUsageSource::Cgroups:
|
||||||
return cgroups_reader->readMemoryUsage();
|
return cgroups_reader != nullptr ? cgroups_reader->readMemoryUsage() : 0;
|
||||||
case MemoryUsageSource::Jemalloc:
|
case MemoryUsageSource::Jemalloc:
|
||||||
#if USE_JEMALLOC
|
#if USE_JEMALLOC
|
||||||
return resident_mib.getValue();
|
return resident_mib.getValue();
|
||||||
|
@ -49,9 +49,7 @@ private:
|
|||||||
|
|
||||||
MemoryUsageSource source{MemoryUsageSource::None};
|
MemoryUsageSource source{MemoryUsageSource::None};
|
||||||
|
|
||||||
#if defined(OS_LINUX)
|
|
||||||
std::shared_ptr<ICgroupsReader> cgroups_reader;
|
std::shared_ptr<ICgroupsReader> cgroups_reader;
|
||||||
#endif
|
|
||||||
|
|
||||||
#if USE_JEMALLOC
|
#if USE_JEMALLOC
|
||||||
JemallocMibCache<uint64_t> epoch_mib{"epoch"};
|
JemallocMibCache<uint64_t> epoch_mib{"epoch"};
|
||||||
|
Loading…
Reference in New Issue
Block a user