From d36537a4454a003106d48f7a286f362fd3b8f25e Mon Sep 17 00:00:00 2001 From: Rohit Agrawal Date: Thu, 12 Feb 2026 17:48:25 -0800 Subject: [PATCH 1/3] deps: bump up tcmalloc version Signed-off-by: Rohit Agrawal --- bazel/deps.yaml | 2 +- bazel/repository_locations.bzl | 4 ++-- bazel/tcmalloc.patch | 4 ++-- test/common/common/matchers_test.cc | 6 +++--- test/exe/main_common_test.cc | 5 ++++- test/integration/stats_integration_test.cc | 3 ++- 6 files changed, 14 insertions(+), 10 deletions(-) diff --git a/bazel/deps.yaml b/bazel/deps.yaml index 36cdffb2d766c..62c36cae0babb 100644 --- a/bazel/deps.yaml +++ b/bazel/deps.yaml @@ -295,7 +295,7 @@ tcmalloc: project_name: "tcmalloc" project_desc: "Fast, multi-threaded malloc implementation" project_url: "https://github.com/google/tcmalloc" - release_date: "2024-12-27" + release_date: "2025-10-13" use_category: - dataplane_core - controlplane diff --git a/bazel/repository_locations.bzl b/bazel/repository_locations.bzl index cc77f2b8361f0..9b9bbf5503e50 100644 --- a/bazel/repository_locations.bzl +++ b/bazel/repository_locations.bzl @@ -165,8 +165,8 @@ REPOSITORY_LOCATIONS_SPEC = dict( urls = ["https://github.com/google/libsxg/archive/{version}.tar.gz"], ), tcmalloc = dict( - version = "5da4a882003102fba0c0c0e8f6372567057332eb", - sha256 = "fd92d64d8302f1677570fdff844e8152c314e559a6c788c6bfc3844954d0dabd", + version = "1ac44428cd63fef2c44a7302c6fe33a7d5a28eeb", + sha256 = "5172d0cdfe975b9253a67eefa6e19fa6e4f23b596f0d9247959941adf0d57c6c", strip_prefix = "tcmalloc-{version}", urls = ["https://github.com/google/tcmalloc/archive/{version}.tar.gz"], ), diff --git a/bazel/tcmalloc.patch b/bazel/tcmalloc.patch index 7ce1a2f36136f..0b4df116e1f1f 100644 --- a/bazel/tcmalloc.patch +++ b/bazel/tcmalloc.patch @@ -1,8 +1,8 @@ diff --git a/tcmalloc/BUILD b/tcmalloc/BUILD --- a/tcmalloc/BUILD 2025-01-28 16:41:20.424424728 +0000 +++ b/tcmalloc/BUILD 2025-01-28 16:41:09.408433981 +0000 -@@ -21,7 +21,7 @@ - load("//tcmalloc:copts.bzl", "TCMALLOC_DEFAULT_COPTS") +@@ -24,7 +24,7 @@ + load("//tcmalloc:copts.bzl", "TCMALLOC_DEFAULT_COPTS", "TCMALLOC_DEFAULT_CXXOPTS") load("//tcmalloc:variants.bzl", "create_tcmalloc_benchmark", "create_tcmalloc_libraries", "create_tcmalloc_testsuite") -package(default_visibility = ["//visibility:private"]) diff --git a/test/common/common/matchers_test.cc b/test/common/common/matchers_test.cc index a151090984644..59f227523d354 100644 --- a/test/common/common/matchers_test.cc +++ b/test/common/common/matchers_test.cc @@ -472,9 +472,9 @@ TEST_F(StringMatcher, Memory) { // The memory constraints were added to ensure that the amount of memory // used by matchers is carefully analyzed. These constraints can be relaxed // when additional features are added, but it should be done in a thoughtful manner. - // Adding 3*8192 bytes because tcmalloc consumption estimation may return + // Adding 5*8192 bytes because tcmalloc consumption estimation may return // different values depending on memory alignment. - EXPECT_MEMORY_LE(prefix_consumed_bytes, 530176 + 3 * 8192); + EXPECT_MEMORY_LE(prefix_consumed_bytes, 530176 + 5 * 8192); } // Regex matcher. { @@ -494,7 +494,7 @@ TEST_F(StringMatcher, Memory) { // when additional features are added, but it should be done in a thoughtful manner. // Adding 10*8192 bytes because tcmalloc consumption estimation may return // different values depending on memory alignment. - EXPECT_MEMORY_LE(regex_consumed_bytes, 15038016 + 10 * 8192); + EXPECT_MEMORY_LE(regex_consumed_bytes, 15603776 + 10 * 8192); } } diff --git a/test/exe/main_common_test.cc b/test/exe/main_common_test.cc index c819a789f8ffe..bb1a4f729ee68 100644 --- a/test/exe/main_common_test.cc +++ b/test/exe/main_common_test.cc @@ -242,7 +242,10 @@ TEST_P(MainCommonDeathTest, OutOfMemoryHandler) { // Allocating a fixed-size large array that results in OOM on gcc // results in a compile-time error on clang of "array size too big", // so dynamically find a size that is too large. - const uint64_t initial = 1 << 30; + // Start with a size that exceeds the x86_64 virtual address space limit (128TB) + // so that mmap fails immediately and tcmalloc prints its "Unable to allocate" + // message to stderr. + const uint64_t initial = uint64_t{1} << 46; for (uint64_t size = initial; size >= initial; // Disallow wraparound to avoid infinite loops on failure. size *= 1000) { diff --git a/test/integration/stats_integration_test.cc b/test/integration/stats_integration_test.cc index 541c7bf785c70..ecaff4e1be266 100644 --- a/test/integration/stats_integration_test.cc +++ b/test/integration/stats_integration_test.cc @@ -402,6 +402,7 @@ TEST_P(ClusterMemoryTestRunner, MemoryLargeClusterSize) { // 2022/10/27 44000 Update tcmalloc // 2025/07/28 40266 44299 44500 Add request_count_ field to ActiveClient // 2026/01/23 44528 45000 Fix test flakes + // 2026/02/13 43467 45575 46000 Update tcmalloc to 1ac44428cd63 (2025-10-13) // Note: when adjusting this value: EXPECT_MEMORY_EQ is active only in CI // 'release' builds, where we control the platform and tool-chain. So you @@ -416,7 +417,7 @@ TEST_P(ClusterMemoryTestRunner, MemoryLargeClusterSize) { // https://github.com/envoyproxy/envoy/blob/main/source/docs/stats.md#stats-memory-tests // for details on how to fix. - EXPECT_MEMORY_LE(m_per_cluster, 45000); // Round up to allow platform variations. + EXPECT_MEMORY_LE(m_per_cluster, 46000); // Round up to allow platform variations. } TEST_P(ClusterMemoryTestRunner, MemoryLargeHostSizeWithStats) { From c81c8b17d87fa0134aba68d8fed59145a60c2eb1 Mon Sep 17 00:00:00 2001 From: Rohit Agrawal Date: Wed, 18 Feb 2026 16:38:09 -0800 Subject: [PATCH 2/3] addressed comments from @phlax Signed-off-by: Rohit Agrawal --- bazel/deps.yaml | 2 +- bazel/repository_locations.bzl | 4 ++-- test/integration/stats_integration_test.cc | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/bazel/deps.yaml b/bazel/deps.yaml index 176eae777309d..c163c6d5aede9 100644 --- a/bazel/deps.yaml +++ b/bazel/deps.yaml @@ -295,7 +295,7 @@ tcmalloc: project_name: "tcmalloc" project_desc: "Fast, multi-threaded malloc implementation" project_url: "https://github.com/google/tcmalloc" - release_date: "2025-10-13" + release_date: "2025-09-27" use_category: - dataplane_core - controlplane diff --git a/bazel/repository_locations.bzl b/bazel/repository_locations.bzl index bd7bc7ec3560d..8ca6aaa9a9a11 100644 --- a/bazel/repository_locations.bzl +++ b/bazel/repository_locations.bzl @@ -165,8 +165,8 @@ REPOSITORY_LOCATIONS_SPEC = dict( urls = ["https://github.com/google/libsxg/archive/{version}.tar.gz"], ), tcmalloc = dict( - version = "1ac44428cd63fef2c44a7302c6fe33a7d5a28eeb", - sha256 = "5172d0cdfe975b9253a67eefa6e19fa6e4f23b596f0d9247959941adf0d57c6c", + version = "12f255231938d30493186b0a037feedd70f5a1c1", + sha256 = "2a6bef88f8cccda4a63a2f4bb09e655b3ee5ea0a2ce68d16e6ea2d5f5c4be9c1", strip_prefix = "tcmalloc-{version}", urls = ["https://github.com/google/tcmalloc/archive/{version}.tar.gz"], ), diff --git a/test/integration/stats_integration_test.cc b/test/integration/stats_integration_test.cc index ecaff4e1be266..394d8af54de0c 100644 --- a/test/integration/stats_integration_test.cc +++ b/test/integration/stats_integration_test.cc @@ -402,7 +402,7 @@ TEST_P(ClusterMemoryTestRunner, MemoryLargeClusterSize) { // 2022/10/27 44000 Update tcmalloc // 2025/07/28 40266 44299 44500 Add request_count_ field to ActiveClient // 2026/01/23 44528 45000 Fix test flakes - // 2026/02/13 43467 45575 46000 Update tcmalloc to 1ac44428cd63 (2025-10-13) + // 2026/02/13 43467 45575 46000 Update tcmalloc to 12f2552 (2025-09-27) // Note: when adjusting this value: EXPECT_MEMORY_EQ is active only in CI // 'release' builds, where we control the platform and tool-chain. So you From 4dc1f1888149ebfff3f976a0b8a4e7b4d7a24e44 Mon Sep 17 00:00:00 2001 From: Rohit Agrawal Date: Wed, 18 Feb 2026 18:49:07 -0800 Subject: [PATCH 3/3] fix date Signed-off-by: Rohit Agrawal --- bazel/deps.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bazel/deps.yaml b/bazel/deps.yaml index c163c6d5aede9..e2b9013a411ac 100644 --- a/bazel/deps.yaml +++ b/bazel/deps.yaml @@ -295,7 +295,7 @@ tcmalloc: project_name: "tcmalloc" project_desc: "Fast, multi-threaded malloc implementation" project_url: "https://github.com/google/tcmalloc" - release_date: "2025-09-27" + release_date: "2025-09-26" use_category: - dataplane_core - controlplane