Skip to content

fix: Memory Leak when create PullConsumer#2027

Merged
piotrpio merged 3 commits intonats-io:mainfrom
txuna:fix/memory-leak
Mar 3, 2026
Merged

fix: Memory Leak when create PullConsumer#2027
piotrpio merged 3 commits intonats-io:mainfrom
txuna:fix/memory-leak

Conversation

@txuna
Copy link
Contributor

@txuna txuna commented Feb 23, 2026

fix: Memory Leak when create PullConsumer. So, add RemoveStatusListener in Consumer

Additional explanation

When create Consumer, allocate sub.connStatusChanged

sub.connStatusChanged = p.js.conn.StatusChanged(nats.CONNECTED, nats.RECONNECTING, nats.CLOSED)

But not delete map when Delete Consumer!

Signed-off-by: txuna <b7712983@naver.com>
Copy link
Collaborator

@piotrpio piotrpio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@txuna thanks for the contribution! I have one suggestion/

@txuna txuna requested a review from piotrpio March 1, 2026 06:40
@txuna txuna requested a review from piotrpio March 2, 2026 12:04
Copy link
Collaborator

@piotrpio piotrpio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thank you for the contribution!

@piotrpio piotrpio merged commit 9941f25 into nats-io:main Mar 3, 2026
5 of 7 checks passed
@txuna txuna deleted the fix/memory-leak branch March 3, 2026 12:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants