kansnow opened a new issue, #208:
URL: https://github.com/apache/pulsar-client-python/issues/208
`import time
import pulsar
import sys
import gc
client = pulsar.Client('pulsar://localhost:6650')
def connect_to_pulsar():
producer = None
try:
producer = client.create_producer('my-topic')
producer.send(b'Hello Pulsar!')
except Exception as e:
print(f"Connection to Pulsar failed: {e}")
finally:
size = sys.getsizeof(client)
print(f"Memory usage of {client.__class__.__name__} object: {size}
bytes")
if producer:
producer.close()
gc.collect()
# 模拟循环尝试连接
for _ in range(1000000):
connect_to_pulsar()
time.sleep(1)
# 循环结束后关闭连接
client.close()`
there is my code,I am using pulsar-client with version 2.9.1. when I run
this code in python3, Process memory keeps growing.
Where exactly is the problem?
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]