Skip to content

Commit

Permalink
Allow GC to collect exported spans
Browse files Browse the repository at this point in the history
  • Loading branch information
ash2k committed Sep 11, 2024
1 parent ed4fc75 commit 48b2fee
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions sdk/trace/batch_span_processor.go
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,7 @@ func (bsp *batchSpanProcessor) exportSpans(ctx context.Context) error {
//
// It is up to the exporter to implement any type of retry logic if a batch is failing
// to be exported, since it is specific to the protocol and backend being sent to.
clear(bsp.batch) // Let GC collect objects
bsp.batch = bsp.batch[:0]

if err != nil {
Expand Down

0 comments on commit 48b2fee

Please sign in to comment.