Closed sspates closed 5 months ago
I'm unable to reproduce it:
In the original code is there perhaps an error where subscriptions are repeatedly created in a loop? That is my only speculation at the moment which might cause an increase in memory allocations.
PS ran above code along side nats pub:
nats pub foo.bar 01234567890123456789012345678901 --count 1000000000 --sleep 100ms
We think the is the result of the push consumer getting backed up with the messages piling up in memory. We will make adjustments on our side to handle this.
Observed behavior
Based on a performance test result from .dot Memory tool we are observing that NATS .Net client library has high memory usage when the client does not unsubscribe.
Memory usage resets if the client reconnects.
Service is being run for 1 hour with constant load during which time memory usage progressively increases.
Here is a simplified version of our connection and subscribe:
Expected behavior
Service memory is at a constant level over the hour
Server and client version
Server: 2.10.9 Library: 1.1.1
Host environment
Windows 10 Enterprise LTSC X86 CPU (various models) Minimum 8GB memory NATS hosted as windows service
Steps to reproduce
See code in observed behavior.
Run for around 1 hour and monitor memory utilization.