nats-io / nats-server

High-Performance server for NATS.io, the cloud and edge native messaging system.
https://nats.io
Apache License 2.0
15.99k stars 1.41k forks source link

Lots of subscriptions caused a memory leak [v2.8.4] #5833

Open wubumihuo opened 2 months ago

wubumihuo commented 2 months ago

Observed behavior

we found when a client has lots of subscriptions (more than 100000), could cause nats-broker memory increase suddenly. And when this client shutdown,subscriptions would decline down; but memory would not decline downpprof_memory

Expected behavior

this client shutdown,subscriptions would decline down; we expected memory also decline down

Server and client version

Version: 2.8.4 Go build: go1.18.8

Host environment

No response

Steps to reproduce

No response

neilalexander commented 2 months ago

2.8.4 is extremely old, can you please try again with the most recent version?