GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — [feat][misc] Support AdaptiveByteBufAllocator with configurable allocator type and metrics by lhotari · Pull Request #26595 · apache/pulsar

Conversation

@lhotari

@lhotari lhotari commented Sep 15, 2026

Copy link
Copy Markdown
Member

Motivation

Pulsar's allocator currently offers pooled direct allocation or unpooled heap allocation. Allow deployments and clients to opt into Netty's AdaptiveByteBufAllocator while retaining Pulsar's OOM handling and leak detection policies.

Modifications

  • Add pulsar.allocator.type with case-insensitive pooled, unpooled, and adaptive enum values. Unsupported values fail configuration parsing.
  • Deprecate pulsar.allocator.pooled and retain it as a fallback when the new property is absent. Pooled allocation remains the default.
  • Enable adaptive allocation with -Dpulsar.allocator.type=adaptive, using Netty's default adaptive constructor inside the existing BookKeeper allocator wrapper.
  • Read JVM and broker allocator statistics from the selected allocator. Adaptive pool allocated/used metrics report usedDirectMemory(); broker statistics report heap/direct memory totals with empty arena lists. Existing pooled arena statistics remain available.
  • Document the property in conf/pulsar_env.sh and add tests for selection, precedence, invalid values, allocations, OOM policies, and metrics.

Verifying this change

  • Make sure that the change passes the CI checks.

Local validation:

./gradlew :pulsar-common:test --tests 'org.apache.pulsar.common.allocator.*' \
  :pulsar-broker:test --tests 'org.apache.pulsar.broker.stats.AllocatorStatsGeneratorTest' \
  spotlessCheck checkstyleMain checkstyleTest

All 19 scoped tests passed, along with license-header and checkstyle checks.

Does this pull request potentially affect one of the following parts:

  • Dependencies (add or upgrade a dependency)
  • The public API — adds AllocatorType, the allocator-type property constant, and a metric accessor; deprecates the legacy property constant.
  • The schema
  • The default values of configurations
  • The threading model
  • The binary protocol
  • The REST endpoints — default allocator stats reflect the selected allocator, retaining the response schema.
  • The admin CLI options
  • The metrics — report the selected allocator's memory consumption; adaptive used memory includes retained reusable capacity.
  • Anything that affects deployment — introduces the opt-in allocator-type system property.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
lhotari added 3 commits September 15, 2026 17:15
@lhotari
[feat][common] Support adaptive byte buffer allocation and metrics
5dd1b17
Add case-insensitive pulsar.allocator.type selection with legacy pooled-property fallback. Report selected allocator memory in JVM metrics and broker allocator stats while preserving OOM handling.

Assisted-by: Codex
@lhotari
[fix][common] Report adaptive backing memory as used memory
ad18a41
Use the allocator usedDirectMemory metric for default_pool_used when chunk occupancy metrics are unavailable.

Assisted-by: Codex
@lhotari
[improve][misc] Use the default adaptive allocator constructor
f8ba69e
@lhotari
lhotari requested review from Technoboy-, dao-jun, david-streamlio, merlimat and nodece September 15, 2026 15:14
lhotari added 3 commits September 15, 2026 18:17
@lhotari
[cleanup][build] Use allocator type property in tests and documentation
b69a0bb
Assisted-by: Codex
@lhotari
[doc] List supported allocator types in pulsar environment configuration
f5bfb6f
@lhotari
[doc] Clarify deprecated pooled allocator option and replacement
b7ccc29
merlimat
merlimat approved these changes Sep 15, 2026
View reviewed changes
@lhotari lhotari added this to the 5.0.0 milestone Sep 15, 2026
@lhotari lhotari mentioned this pull request Sep 15, 2026
[feat][ml] Configure and track named Pulsar allocators independently #26597
Merged
5 of 11 tasks
@merlimat
merlimat merged commit e1a1581 into apache:master Sep 15, 2026
43 checks passed

Uh oh!

There was an error while loading. Please reload this page.

dao-jun pushed a commit to ascentstream/pulsar that referenced this pull request Sep 20, 2026
@lhotari @dao-jun
[feat][misc] Support AdaptiveByteBufAllocator with configurable alloc…
4836724
…ator type and metrics (apache#26595)

(cherry picked from commit e1a1581)
dao-jun pushed a commit to ascentstream/pulsar that referenced this pull request Sep 20, 2026
@lhotari @dao-jun
[feat][misc] Support AdaptiveByteBufAllocator with configurable alloc…
e68c63e
…ator type and metrics (apache#26595)

(cherry picked from commit e1a1581)
dao-jun pushed a commit to ascentstream/pulsar that referenced this pull request Sep 20, 2026
@lhotari @dao-jun
[feat][misc] Support AdaptiveByteBufAllocator with configurable alloc…
b271678
…ator type and metrics (apache#26595)

(cherry picked from commit e1a1581)
@dao-jun dao-jun mentioned this pull request Oct 4, 2026
[feat][ml] Port batch read and managed-ledger cache improvements (PIP-430) on BK 4.17.4.1 ascentstream/pulsar#105
Closed
Radiancebobo pushed a commit to Radiancebobo/pulsar that referenced this pull request Oct 8, 2026
@lhotari hechengbo
[feat][misc] Support AdaptiveByteBufAllocator with configurable alloc…
e90de3e
…ator type and metrics (apache#26595)
@nodece nodece mentioned this pull request Oct 13, 2026
[feat][ml] Port batch read and managed-ledger cache improvements (PIP-430) on BK 4.17.4.1 (ml-only subset) ascentstream/pulsar#106
Closed
nodece pushed a commit to ascentstream/pulsar that referenced this pull request Oct 13, 2026
@lhotari @nodece
[feat][misc] Support AdaptiveByteBufAllocator with configurable alloc…
cd44039
…ator type and metrics (apache#26595)

(cherry picked from commit e1a1581)
(cherry picked from commit b271678)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@merlimat merlimat merlimat approved these changes
@nodece nodece Awaiting requested review from nodece
@dao-jun dao-jun Awaiting requested review from dao-jun
@Technoboy- Technoboy- Awaiting requested review from Technoboy-
@david-streamlio david-streamlio Awaiting requested review from david-streamlio

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

5.0.0

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@lhotari @merlimat
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.