You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#include<pulsar/Client.h>
#include<chrono>
#include<thread>usingnamespacepulsar;intmain() {
Client client("pulsar://localhost:6650");
while (true) {
Producer producer;
auto result = client.createProducer("my-topic", producer);
if (result != ResultOk) {
break;
}
producer.close();
std::this_thread::sleep_for(std::chrono::milliseconds(500));
}
client.close();
}
What did you expect to see?
The memory usage should be stable.
What did you see instead?
The program above just create producers in loop. However, the memory usage keeps increasing after some time (in my local env, after the 27th producer is created, each time a producer is created and closed, 16KB memory usage will be increased)
Here is a simple script to detect memory usage on Linux (assuming the program name is SampleProducer):
Activity
[fix] Remove closed producers and consumers from client
BewareMyPower commentedon Oct 19, 2022
With patch from #54, the memory keeps stable (even if I sent a message in each iteration), see
[fix] Fix memory leak caused by incorrect close and destruction
[fix] Fix memory leak caused by incorrect close and destruction (apac…
[flaky tests] Fix flaky ShutdownTest::testDestructor
[flaky tests] Fix flaky ShutdownTest::testDestructor (#62)
[flaky tests] Fix flaky ShutdownTest::testDestructor (#62)
[fix] Fix memory leak caused by incorrect close and destruction (#54)