Skip to content

Collector memory increases by about ~20 MB after v0.125.0 release #13014

Closed
@sfc-gh-bnandibhatla

Description

@sfc-gh-bnandibhatla

Component(s)

service

What happened?

Describe the bug

We noticed that the collector memory increases by about ~20 MB after the latest release. Here's a graph (plotted using otelcol_process_memory_rss metric) showing the memory of the collector running an older version (v0.120.0) and the newer version:

Image

Steps to reproduce

Upgrade the collector to the latest version

What did you expect to see?

Very minimal increase in memory used by the collector.

What did you see instead?

The memory increased by about ~20 MB.

Collector version

v0.125.0

Environment information

Environment

OS: Centos7
Compiler(if manually compiled): go 1.23.7

Additional context

We collected heap profiles from both old and new versions of the collector. Here's the heap profile from old version:

Image

Here's the heap profile from the new version of the collector:

Image

It looks like the memory increase is because of a new usage of zap somewhere (go.uber.org/zap/zapcore.newCounters). Drilling down using the flamegraph shows the call stack:

Image

The call to the zapcore.NewSamplerWithOptions seems to be added here: #12617. The ~20 MB increase seems excessive just to maintains some logging related counters.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions