You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@impala.apache.org by jo...@apache.org on 2026/06/09 18:04:54 UTC

(impala) 01/02: IMPALA-15021: Remove duplicate tcmalloc.thread_cache_free_bytes metric

This is an automated email from the ASF dual-hosted git repository.

asf-gitbox-commits pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/impala.git

commit aac753cb3208effb6f41f916b53a17a05ed967c6
Author: Joe McDonnell <jo...@cloudera.com>
AuthorDate: Tue May 26 11:30:22 2026 -0700

    IMPALA-15021: Remove duplicate tcmalloc.thread_cache_free_bytes metric
    
    In IMPALA-14874, we introduced several tcmalloc metrics
    including tcmalloc.current-total-thread-cache-bytes and
    tcmalloc.thread-cache-free-bytes. These are actually the
    same underlying metric, so this removes tcmalloc.thread-cache-free-bytes.
    
    Testing:
     - Ran core tests
    
    Change-Id: I7ff431b00c10fe9ff99bfd6c909739d8a97fcf3a
    Reviewed-on: http://gerrit.cloudera.org:8080/24399
    Reviewed-by: Michael Smith <mi...@cloudera.com>
    Reviewed-by: Csaba Ringhofer <cs...@cloudera.com>
    Tested-by: Joe McDonnell <jo...@cloudera.com>
---
 be/src/util/memory-metrics.cc |  5 -----
 be/src/util/memory-metrics.h  |  3 ---
 be/src/util/metrics-test.cc   |  4 ----
 common/thrift/metrics.json    | 14 +-------------
 4 files changed, 1 insertion(+), 25 deletions(-)

diff --git a/be/src/util/memory-metrics.cc b/be/src/util/memory-metrics.cc
index 9cc0bb3e0..021209599 100644
--- a/be/src/util/memory-metrics.cc
+++ b/be/src/util/memory-metrics.cc
@@ -59,7 +59,6 @@ TcmallocMetric* TcmallocMetric::PAGEHEAP_UNMAPPED_BYTES = nullptr;
 TcmallocMetric* TcmallocMetric::CURRENT_TOTAL_THREAD_CACHE_BYTES = nullptr;
 TcmallocMetric* TcmallocMetric::CENTRAL_CACHE_FREE_BYTES = nullptr;
 TcmallocMetric* TcmallocMetric::TRANSFER_CACHE_FREE_BYTES = nullptr;
-TcmallocMetric* TcmallocMetric::THREAD_CACHE_FREE_BYTES = nullptr;
 TcmallocMetric::PhysicalBytesMetric* TcmallocMetric::PHYSICAL_BYTES_RESERVED = nullptr;
 
 SanitizerMallocMetric* SanitizerMallocMetric::BYTES_ALLOCATED = nullptr;
@@ -146,10 +145,6 @@ Status impala::RegisterMemoryMetrics(MetricGroup* metrics, bool register_jvm_met
       tcmalloc_metrics, "tcmalloc.transfer-cache-free-bytes",
       "tcmalloc.transfer_cache_free_bytes");
 
-  TcmallocMetric::THREAD_CACHE_FREE_BYTES = TcmallocMetric::CreateAndRegister(
-      tcmalloc_metrics, "tcmalloc.thread-cache-free-bytes",
-      "tcmalloc.thread_cache_free_bytes");
-
   TcmallocMetric::PHYSICAL_BYTES_RESERVED =
       tcmalloc_metrics->RegisterMetric(new TcmallocMetric::PhysicalBytesMetric(
           MetricDefs::Get("tcmalloc.physical-bytes-reserved")));
diff --git a/be/src/util/memory-metrics.h b/be/src/util/memory-metrics.h
index 19930e46a..7c068606c 100644
--- a/be/src/util/memory-metrics.h
+++ b/be/src/util/memory-metrics.h
@@ -118,9 +118,6 @@ class TcmallocMetric : public IntGauge {
   /// Number of free bytes waiting to be transferred between central and thread caches.
   static TcmallocMetric* TRANSFER_CACHE_FREE_BYTES;
 
-  /// Number of free bytes in thread caches.
-  static TcmallocMetric* THREAD_CACHE_FREE_BYTES;
-
   /// Derived metric computing the amount of physical memory (in bytes) used by the
   /// process, including that actually in use and free bytes reserved by tcmalloc. Does not
   /// include the tcmalloc metadata.
diff --git a/be/src/util/metrics-test.cc b/be/src/util/metrics-test.cc
index b8f6ef587..4c8eb6938 100644
--- a/be/src/util/metrics-test.cc
+++ b/be/src/util/metrics-test.cc
@@ -287,10 +287,6 @@ TEST_F(MetricsTest, MemMetric) {
   IntGauge* transfer_cache_free_bytes =
       metrics.FindMetricForTesting<IntGauge>("tcmalloc.transfer-cache-free-bytes");
   ASSERT_TRUE(transfer_cache_free_bytes != NULL);
-
-  IntGauge* thread_cache_free_bytes =
-      metrics.FindMetricForTesting<IntGauge>("tcmalloc.thread-cache-free-bytes");
-  ASSERT_TRUE(thread_cache_free_bytes != NULL);
 #endif
 }
 
diff --git a/common/thrift/metrics.json b/common/thrift/metrics.json
index 51761f752..381392222 100644
--- a/common/thrift/metrics.json
+++ b/common/thrift/metrics.json
@@ -2609,7 +2609,7 @@
     "key": "tcmalloc.total-bytes-reserved"
   },
   {
-    "description": "Number of bytes used across all thread caches.",
+    "description": "Number of bytes used across all thread caches. They always count towards virtual memory usage, and unless the underlying memory is swapped out by the OS, they also count towards physical memory usage.",
     "contexts": [
       "STATESTORE",
       "CATALOGSERVER",
@@ -2644,18 +2644,6 @@
     "kind": "GAUGE",
     "key": "tcmalloc.transfer-cache-free-bytes"
   },
-  {
-    "description": "Number of free bytes in thread caches. They always count towards virtual memory usage, and unless the underlying memory is swapped out by the OS, they also count towards physical memory usage.",
-    "contexts": [
-      "STATESTORE",
-      "CATALOGSERVER",
-      "IMPALAD"
-    ],
-    "label": "TCMalloc Thread Cache Free Bytes",
-    "units": "BYTES",
-    "kind": "GAUGE",
-    "key": "tcmalloc.thread-cache-free-bytes"
-  },
   {
     "description": "Bytes allocated from the sanitizer malloc (Sanitizer debug builds only)",
     "contexts": [