Closed matchish closed 3 years ago
Hi @matchish, stopping a subscribeToStreamFrom
subscription does not dispose of the underlying connection. Please use the newly added close
function which will stop the subscription and release and destroy the singular connection pool used for subscriptions.
const client: TCPClient = clientFactory()
for (;;) {
const subscription = await client.subscribeToStreamFrom('$ce-Company', 0, () => {});
subscription.close();
const memory = process.memoryUsage();
console.log(`Memory used ${memory.heapUsed}`);
}
If I want to resubscribe to a stream
Memory consumption increasing every loop