datadog-go icon indicating copy to clipboard operation
datadog-go copied to clipboard

statsd buffer heap running out of memory

Open ahaq0 opened this issue 4 years ago • 5 comments

Hi,

Have a long running go routine to refresh a device auth token and was noticing a sharp increase in memory.

used pprof and idenitifed data dog's statsd buffer go keeping all the memory. More specifically, statsd.nextStatsBuffer have the max default size set for the buffer and initialize the buffer with the regular http client.

Tried forcing flush on statsd to no avail but the leak persists, any leads?

ahaq0 avatar Nov 03 '22 17:11 ahaq0

I've encountered a similar situation with statsd.nextStatsBuffer steadily growing its memory footprint in a long running process that has a couple of goroutines.

[email protected]/statsd/buffer.go dominates the heap live size google/[email protected] tops the heap live objects (with stats/buffer.go a close third)

Jecoms avatar Dec 06 '22 17:12 Jecoms

I've encountered similar case with statsd.nextStatsBuffer in v4.2.0

statsd is on the top both of allocs and heap analyzed using pprof

fathiraz avatar Mar 01 '23 08:03 fathiraz

encountered the same problem

arturg-acoustic avatar Apr 03 '24 07:04 arturg-acoustic

Any solutions?

ttdias25 avatar Jul 03 '24 13:07 ttdias25

Any solutions?

Increase your memory might help. I find that newStatsBuffer takes up alot of memory as well.

willshen8 avatar Sep 10 '25 07:09 willshen8