Skip to content

Memory optimization suggestion #6620

@saguiitay

Description

@saguiitay

Package

OpenTelemetry

Is your feature request related to a problem?

Setting CardinalityLimit to a high number (e.g 50K) might result in OutOfMemory exceptions.
We're allocating AggregatorStore's metricPoints and currentMetricPointBatch, even if the metric is never emitted.

What is the expected behavior?

We could:

  1. Allocate the metricPoints and currentMetricPointBatch arrays lazily (upon first usage)
  2. Allocate metricPoints and currentMetricPointBatch with a smaller size, and scale them as needed - after all CardinalityLimit is a LIMIT, not necessarily the expected size.

Which alternative solutions or features have you considered?

We just used a much lower value for CardinalityLimit, with the hope we're not losing any data.

Additional context

No response

Tip

React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding +1 or me too, to help us triage it. Learn more here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestneeds-triageNew issues which have not been classified or triaged by a community memberpkg:OpenTelemetryIssues related to OpenTelemetry NuGet package

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions