-
Notifications
You must be signed in to change notification settings - Fork 627
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BulkIndexer memory leak? #956
Comments
Update: It seems like memory usage drops down eventually over time (several minutes past the point memory peaks), but the initial spike from ~8mb to 300mb is pretty unexpected. Could there be some internal resource that's eventually timing out and freeing up after some amount of time? |
It does seem related to So basically... This leaks: indexer, _ := esutil.NewBulkIndexer(esutil.BulkIndexerConfig{
Index: "some-index",
Client: s.client, // a pointer to elasticsearch.Client
})
ctx := context.Background()
indexer.Close(ctx) This does not leak: indexer, _ := esutil.NewBulkIndexer(esutil.BulkIndexerConfig{
Index: "some-index",
Client: s.client, // a pointer to elasticsearch.Client
})
ctx := context.Background()
//indexer.Close(ctx) |
Looks like there's already a PR for this: #701 |
I'm observing what appears to be a memory leak when using a
BulkIndexer
. I noticed that my application's memory was growing rapidly as usage of the BulkIndexer increased. I thought it was maybe my own code in how I was handling the bulk index items, but I commented out the entire thing and was able to replicate the issue by simply triggering a scenario that ran this code successively:You don't even need to add any items. Just triggering this code multiple times results in a massive increase in memory after a few iterations. My application uses like 8mb of memory after startup. Simply invoking the above code 3-4 times causes that to jump to 160mb. Another time after that and it goes up to 300+mb.
I am using package version v8.17.1.
The text was updated successfully, but these errors were encountered: