You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by lh...@apache.org on 2026/09/16 13:26:46 UTC
(pulsar) 02/02: [fix][ml] Clarify managed cache allocator default
This is an automated email from the ASF dual-hosted git repository.
lhotari pushed a commit to branch lhotari-improve-ml-cache-adaptive
in repository https://gitbox.apache.org/repos/asf/pulsar.git
commit cd103880372c6498c5fcc19f992a5137fd874de1
Author: Lari Hotari <lh...@apache.org>
AuthorDate: Wed Sep 16 16:26:31 2026 +0300
[fix][ml] Clarify managed cache allocator default
Keep the pooled fallback explicit for the default allocator while using adaptive for ml-cache when no allocator type is configured.
Assisted-by: Codex
---
.../org/apache/pulsar/common/allocator/PulsarByteBufAllocator.java | 3 +++
1 file changed, 3 insertions(+)
diff --git a/pulsar-common/src/main/java/org/apache/pulsar/common/allocator/PulsarByteBufAllocator.java b/pulsar-common/src/main/java/org/apache/pulsar/common/allocator/PulsarByteBufAllocator.java
index 7f6cb458ac50..ecee291778d6 100644
--- a/pulsar-common/src/main/java/org/apache/pulsar/common/allocator/PulsarByteBufAllocator.java
+++ b/pulsar-common/src/main/java/org/apache/pulsar/common/allocator/PulsarByteBufAllocator.java
@@ -143,6 +143,9 @@ public class PulsarByteBufAllocator {
if (pooled != null) {
return "true".equalsIgnoreCase(pooled) ? AllocatorType.POOLED : AllocatorType.UNPOOLED;
}
+ if (DEFAULT_ALLOCATOR_NAME.equals(id)) {
+ return AllocatorType.POOLED;
+ }
// Cache copies are commonly small, similarly sized entries. Adaptive reuses freed size-class slots
// within smaller chunks, limiting fragmentation from entries with different cache lifetimes.
return ML_CACHE_ALLOCATOR_NAME.equals(id) ? AllocatorType.ADAPTIVE : AllocatorType.POOLED;