elastic icon indicating copy to clipboard operation
elastic copied to clipboard

Reduce memory usage on bigger search hits result

Open kh411d opened this issue 4 years ago • 1 comments

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

pprof

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?

kh411d avatar Jul 05 '21 08:07 kh411d

Which amount of memory usage would be acceptable for your application? That's 1.4 MB—not too uncommon these days.

olivere avatar Jul 06 '21 06:07 olivere