-
Notifications
You must be signed in to change notification settings - Fork 806
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Describe your environment
OS: Debian 12 (Bookworm)
Python version: Python 3.11.2
SDK version: 1.30.0
API version: 1.30.0
What happened?
BatchLogRecordProcessor is not garbage collected, causing a memory leak
Steps to Reproduce
import gc
from opentelemetry.exporter.otlp.proto.grpc._log_exporter import OTLPLogExporter
from opentelemetry.sdk._logs.export import BatchLogRecordProcessor
for _ in range(10):
processor = BatchLogRecordProcessor(OTLPLogExporter("test"))
processor.shutdown()
del processor
gc.collect()
for obj in gc.get_objects():
if isinstance(obj, BatchLogRecordProcessor):
print(obj)
Expected Result
No BatchLogRecordProcessor objects should remain
Actual Result
One BatchLogRecordProcessor object is found for each instantiation and consumes ~240KiB of heap as measured by memray
Additional context
No response
Would you like to implement a fix?
None
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working