[6.2.x] Add support for maxInflateDataSize to limit uncompressed buffers (#2139) by cshannon · Pull Request #2147 · apache/activemq · GitHub
Skip to content

[6.2.x] Add support for maxInflateDataSize to limit uncompressed buffers (#2139)#2147

Merged
cshannon merged 1 commit into
apache:activemq-6.2.xfrom
cshannon:backport-2139-6.2.x
Jun 23, 2026
Merged

[6.2.x] Add support for maxInflateDataSize to limit uncompressed buffers (#2139)#2147
cshannon merged 1 commit into
apache:activemq-6.2.xfrom
cshannon:backport-2139-6.2.x

Conversation

@cshannon

Copy link
Copy Markdown
Contributor

This change adds support for limiting the maximum inflation size of a message body when a message needs to be decompressed. This new setting will help prevent OOM errors from large buffers being allocated.

The primary concern this is addressing is that compressed messages may be smaller than maxFrameSize and the broker will accept them, but if an event triggers a decompression a huge buffer could be created and cause OOM.

The broker will have a new maxInflateDataSize config that is broker wide because te value isn't tied to a protocol and it will default to 100 MB. Clients are tied to a transport, so it makes more sense to make it as a ratio of maxFrameSize. The default is 10x maxFrameSize if configured which should be enough of a buffer under normal circumstances. The ratio can be changed using maxInflatedDataSizeRatio on a connection.

(cherry picked from commit 94a4056)

…che#2139)

This change adds support for limiting the maximum inflation size of a
message body when a message needs to be decompressed. This new setting
will help prevent OOM errors from large buffers being allocated.

The primary concern this is addressing is that compressed messages may
be smaller than maxFrameSize and the broker will accept them, but if an
event triggers a decompression a huge buffer could be created and cause
OOM.

The broker will have a new maxInflateDataSize config that is broker wide
because te value isn't tied to a protocol and it will default to 100 MB.
Clients are tied to a transport, so it makes more sense to make it as a
ratio of maxFrameSize. The default is 10x maxFrameSize if configured
which should be enough of a buffer under normal circumstances. The ratio
can be changed using maxInflatedDataSizeRatio on a connection.

(cherry picked from commit 94a4056)
@cshannon cshannon self-assigned this Jun 23, 2026
@cshannon cshannon merged commit afd714e into apache:activemq-6.2.x Jun 23, 2026
3 of 4 checks passed
@cshannon cshannon deleted the backport-2139-6.2.x branch June 23, 2026 17:43
@github-project-automation github-project-automation Bot moved this from Todo to Done in Apache ActiveMQ v6.2.7 Jun 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Development

Successfully merging this pull request may close these issues.

1 participant