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 2022/10/19 07:53:18 UTC

[GitHub] [pulsar-client-cpp] BewareMyPower opened a new issue, #55: [Bug] Producer was not clean up after closed

BewareMyPower opened a new issue, #55:
URL: https://github.com/apache/pulsar-client-cpp/issues/55

   ### Search before asking
   
   - [X] I searched in the [issues](https://github.com/apache/pulsar-client-cpp/issues) and found nothing similar.
   
   
   ### Version
   
   - OS: Ubuntu 20.04
   - Pulsar: 2.10.1
   - C++ client: master 7f7653b
   
   ### Minimal reproduce step
   
   ```c++
   #include <pulsar/Client.h>
   #include <chrono>
   #include <thread>
   using namespace pulsar;
   
   int main() {
       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`):
   
   ```bash
   #!/bin/bash
   set -ex
   PROC_ID=$(ps aux | grep "SampleProducer" | grep -v grep | awk '{print $2}')
   if [[ $PROC_ID ]]; then
       for i in {1..100}; do
           cat /proc/$PROC_ID/status | grep VmData
           sleep 1
       done
   fi
   ```
   ![20221019155148](https://user-images.githubusercontent.com/18204803/196630177-9d00ee83-eb0f-4976-ab38-164d965fb139.jpg)
   
   
   
   ### Anything else?
   
   _No response_
   
   ### Are you willing to submit a PR?
   
   - [X] I'm willing to submit a PR!


-- 
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.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [pulsar-client-cpp] merlimat closed issue #55: [Bug] Producer was not clean up after closed

Posted by GitBox <gi...@apache.org>.
merlimat closed issue #55: [Bug] Producer was not clean up after closed
URL: https://github.com/apache/pulsar-client-cpp/issues/55


-- 
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


[GitHub] [pulsar-client-cpp] BewareMyPower commented on issue #55: [Bug] Producer was not clean up after closed

Posted by GitBox <gi...@apache.org>.
BewareMyPower commented on issue #55:
URL: https://github.com/apache/pulsar-client-cpp/issues/55#issuecomment-1283769024

   With patch from #54, the memory keeps stable (even if I sent a message in each iteration), see
   
   ![1](https://user-images.githubusercontent.com/18204803/196664078-0f19bd2d-d99b-49d8-b17f-1ce80e6b021a.jpg)
   
   ![2](https://user-images.githubusercontent.com/18204803/196664216-e79d886f-1fd2-44a1-a03a-e7320b7ca810.jpg)


-- 
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