Skip to content

query cache used memory calculating is not correct, which cause non-stopping old gc. #26938

@xzer

Description

@xzer

Describe the feature:

Elasticsearch version (bin/elasticsearch --version): 5.4.3

Plugins installed: []

JVM version (java -version): 1.8.0_131

OS version (uname -a if on a Unix-like system):Debian 3.16.43-2

Description of the problem including expected versus actual behavior:

We have a cluster with 6 nodes, and with 2gb query cache size configured: [indices.queries.cache.size: 2g], and with 31g jvm heap size, with 24g old gen configured.

We found that our used old gen size is keeping increasing and then finally fall into CMS gc continually, by memory sampling by jvisualvm, we found that there are over than 8M count of long[], and with size almost 10GB. at the first time, we guess there may be memory leak, which causes this, but after we clear our query cache as following:

curl -XPOST 'http://127.0.0.1:9200/_cache/clear?query=true&pretty'

after the one more time CMS gc, we noticed that out jvm heap got more about 10GB free memory than before.

and also, after clear query cache, we did memory sampling again, we got about 3M count of long[] and with size 2.6GB.

It seems that query cache is holding at least 7-8GB memory in fact even we configured it to 2GB.

(I am sorry that I input wrong count, but the memory usage was correct.)

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions