Skip to content

Possible memory leak #1110

@waeljammal

Description

@waeljammal

Hi,

We are using clustering with consul and there seems to be a memory leak with gossip. I started new instances and left them idle for a short while (10 mins) and saw the following in parca.

It keeps accumulating entries in ConcurrentMap and never releases, I've left it running for up to an hour with the same result, memory just keeps increasing.

We do not send anything over gossip so this is purely internal to clustering and we do not subscribe to anything on the cluster gossip.

It seems to eventually flatten out though but after creating over 50K+ objects, not sure what it's allocating here have not looking into it but that concurrent map keeps growing for some time and eats up a decent chunk of memory. I did have a quick look in a debugger but all I could see were 32 entries each containing 0 items and a rw mutex so could not figure out where these in use allocations are going.

We are initializing the cluster like so, basically defaults:

	config := remote.Configure(a.opts.Config.BindAddress, a.opts.Config.BindPort)
	config.AdvertisedHost = fmt.Sprintf("%s:%d", a.opts.Config.AdvertiseHost, a.opts.Config.BindPort)

	if provider, err = consul.NewWithConfig(&api.Config{
		Address: address,
	}); err != nil {
		return err
	}
 
	clusterConfig := cluster.Configure(a.opts.ClusterName, provider, lookup, config, cluster.WithKinds(a.kinds...))
	clusterConfig.RequestTimeoutTime = time.Second * 30

	c := cluster.New(a.as, clusterConfig)
	a.cluster = c
	c.StartMember()

Screenshot 2024-05-07 at 10 42 51 am

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions