You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2021/12/14 07:01:33 UTC
[GitHub] [pulsar] paladin-dalao commented on issue #13267: Pulsar CPP client mem leak
paladin-dalao commented on issue #13267:
URL: https://github.com/apache/pulsar/issues/13267#issuecomment-993218032
> What's your C++ client version? I see
>
> ```
> ==00:00:41:04.793 10873== by 0xCDB4B1: thread<std::_Bind<std::_Mem_fn<void (pulsar::ExecutorService::*)(std::shared_ptr<boost::asio::io_service>)>(pulsar::ExecutorService*, std::shared_ptr<boost::asio::io_service>)> > (thread:135)
> ==00:00:41:04.793 10873== by 0xCDB4B1: pulsar::ExecutorService::ExecutorService() (ExecutorService.cc:30)
> ```
>
> The constructor of `ExecutorService` starts a thread. However, some refactors have been introduced after #12427, please check again with latest master.
>
> BTW, could you upload a (minimum) whole code file and the valgrind command so that I can try to reproduce it in my local env?
1 . gcc version 4.8.5 20150623 (Red Hat 4.8.5-16) (GCC)
2. Test like this, create producer failed
```
#include <pulsar/c/client.h>
#include <stdio.h>
#include <string.h>
int main() {
pulsar_client_configuration_t *conf = pulsar_client_configuration_create();
pulsar_client_t *client = pulsar_client_create("pulsar://localhost:6650", conf);
pulsar_producer_configuration_t* producer_conf = pulsar_producer_configuration_create();
pulsar_producer_configuration_set_batching_enabled(producer_conf, 1);
pulsar_producer_t *producer;
for (int i = 0; i < 1000; i++) {
pulsar_result err = pulsar_client_create_producer(client, "my-topic", producer_conf, &producer);
if (err != pulsar_result_Ok) {
printf("Failed to create producer: %s\n", pulsar_result_str(err));
pulsar_producer_configuration_free(producer_conf);
continue;
}
pulsar_producer_close(producer);
pulsar_producer_free(producer);
pulsar_producer_configuration_free(producer_conf);
}
pulsar_client_close(client);
pulsar_client_free(client);
pulsar_client_configuration_free(conf);
}
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org