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
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?
The text was updated successfully, but these errors were encountered:
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?
The text was updated successfully, but these errors were encountered: