Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unnecessary high memory in sharedcomponent #11818

Closed
bogdandrutu opened this issue Dec 7, 2024 · 1 comment · Fixed by #11826
Closed

Unnecessary high memory in sharedcomponent #11818

bogdandrutu opened this issue Dec 7, 2024 · 1 comment · Fixed by #11826
Assignees
Labels
area:componentstatus bug Something isn't working

Comments

@bogdandrutu
Copy link
Member

bogdandrutu commented Dec 7, 2024

The #10777 added the "capability" to keep all previously reported events in shared components and the list grows unbounded causing memory issues.

Proposed solution: only preserve the last reported event.

@bogdandrutu bogdandrutu added the bug Something isn't working label Dec 7, 2024
@TylerHelmuth
Copy link
Member

TylerHelmuth commented Dec 9, 2024

For a status aggregator I believe it is important that the previous events be played back in order. Since SharedComponent is internal and we control how it is used, and since we only ever add sources during startup, I suggest a circular buffer with a small size. This allows us to replay all the events during startup, but then during normal operation, once we are done adding sources, we won't have to remember every event we've ever sent.

github-merge-queue bot pushed a commit that referenced this issue Dec 18, 2024
…atus count (#11826)

#### Description
Use a ring buffer to only remember the last 5 events. This ensures we
remember a reasonable number of events during startup, so that a status
aggregator gets the events for all instances. Then during normal
operation, when we're done adding sources and no longer need to replay
events, we don't have to remember every single event.

#### Link to tracking issue
Closes
#11818

#### Testing

`go test status_test.go -count 1000 -failfast` still passes with many
tries.
HongChenTW pushed a commit to HongChenTW/opentelemetry-collector that referenced this issue Dec 19, 2024
…atus count (open-telemetry#11826)

#### Description
Use a ring buffer to only remember the last 5 events. This ensures we
remember a reasonable number of events during startup, so that a status
aggregator gets the events for all instances. Then during normal
operation, when we're done adding sources and no longer need to replay
events, we don't have to remember every single event.

#### Link to tracking issue
Closes
open-telemetry#11818

#### Testing

`go test status_test.go -count 1000 -failfast` still passes with many
tries.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:componentstatus bug Something isn't working
Projects
None yet
2 participants