mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-10 09:32:06 +00:00
Fix
This commit is contained in:
parent
bdc82b61f5
commit
f6cc1051c1
@ -199,16 +199,17 @@ PageCache::MemoryStats PageCache::getResidentSetSize() const
|
|||||||
{
|
{
|
||||||
MemoryStats stats;
|
MemoryStats stats;
|
||||||
|
|
||||||
/// Don't spend time on reading smaps if page cache is not used.
|
|
||||||
if (mmaps.empty())
|
|
||||||
return stats;
|
|
||||||
|
|
||||||
#ifdef OS_LINUX
|
#ifdef OS_LINUX
|
||||||
if (use_madv_free)
|
if (use_madv_free)
|
||||||
{
|
{
|
||||||
std::unordered_set<UInt64> cache_mmap_addrs;
|
std::unordered_set<UInt64> cache_mmap_addrs;
|
||||||
{
|
{
|
||||||
std::lock_guard lock(global_mutex);
|
std::lock_guard lock(global_mutex);
|
||||||
|
|
||||||
|
/// Don't spend time on reading smaps if page cache is not used.
|
||||||
|
if (mmaps.empty())
|
||||||
|
return stats;
|
||||||
|
|
||||||
for (const auto & m : mmaps)
|
for (const auto & m : mmaps)
|
||||||
cache_mmap_addrs.insert(reinterpret_cast<UInt64>(m.ptr));
|
cache_mmap_addrs.insert(reinterpret_cast<UInt64>(m.ptr));
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user