Skip to content
This repository has been archived by the owner on Apr 18, 2022. It is now read-only.

Memory keeps growing to cause the pod to restart #34

Open
jaredhshuai opened this issue Apr 6, 2020 · 1 comment
Open

Memory keeps growing to cause the pod to restart #34

jaredhshuai opened this issue Apr 6, 2020 · 1 comment

Comments

@jaredhshuai
Copy link

jaredhshuai commented Apr 6, 2020

I define many custom property for logEntries:

public void Enrich(LogEvent logEvent, ILogEventPropertyFactory propertyFactory)
{
//... something
foreach (var allProperty in AllProperties)
{
var data = dataContext.GetData(allProperty);
if (data != null)
{
var prop = propertyFactory.CreateProperty(allProperty, data);
logEvent.AddOrUpdateProperty(prop);
}
}
}

When I execute LogInfo repeatedly, the memory keeps growing. I ran the service in the k8s cluster and finally exceeded the 1G memory limit, causing the pod to restart.

@jaredhshuai
Copy link
Author

I don't have any configuration for PeriodicBatching, so it uses the default value, that is, BoundedConcurrentQueue has no upper limit. The reason why memory continues to grow is that the consumption is too slow and the production is too fast?
If so, what are the best practices for configuration?

@jaredhshuai jaredhshuai changed the title Memory leak after adding custom property Memory keeps growing to cause the pod to restart Apr 6, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant