elastic
elastic copied to clipboard
Reduce memory usage on bigger search hits result
Please use the following questions as a guideline to help me answer your issue/question without further inquiry. Thank you.
Which version of Elastic are you using?
[ ] elastic.v7 (for Elasticsearch 7.x) [x] elastic.v6 (for Elasticsearch 6.x) [ ] elastic.v5 (for Elasticsearch 5.x) [ ] elastic.v3 (for Elasticsearch 2.x) [ ] elastic.v2 (for Elasticsearch 1.x)
Please describe the expected behavior
I'm asking suggestion how to reduce the memory, I'm trying to load 500 hits, and it seems that the profiling give me a high memory usage on (*SearchService) Do

client := c.Client.Search().
Index(indexName).
Query(boolQuery).
From(0).
Size(500).
Pretty(true)
document, err := client.Do(context.Background())
if err != nil {
defer c.Client.Stop()
return nil, err
}
Please describe the actual behavior
High memory usage
Any steps to reproduce the behavior?
Which amount of memory usage would be acceptable for your application? That's 1.4 MB—not too uncommon these days.