简体   繁体   English

elasticsearch中java lang outofmemoryerror java heap space背后的可能原因是什么

[英]What are the possible reasons behind the java lang outofmemoryerror java heap space in elasticsearch

I have seen lots of java lang outofmemoryerror java heap space in elasticsearch but I could find any help page that describes the possible reasons behind these errors in elastic search.我见过很多java lang outofmemoryerror java heap spaceelasticsearch ,但我能找到一个描述弹性搜索这些错误背后可能的原因任何帮助页面。 I am getting errors for example:我收到错误,例如:

(2015-04-09 13:56:47,527 DEBUGaction.index Emil Blonsky observer: timeout notification from cluster service. timeout setting 1m, time since start 1m) Caused by: java.lang.OutOfMemoryError: Java heap space:

Possible reasons (some of them):可能的原因(其中一些):

  1. putting too much data into that memory, especially because of fielddata (used for sorting, aggregations mostly)将太多数据放入该内存中,尤其是因为 fielddata(主要用于排序、聚合)
  2. configuration mistake, where you thought you set something for heap size, but it was wrong or in the wrong place, and your node starts with the default and that value (min 256MB, max 1GB) is not enough配置错误,您认为您为堆大小设置了一些东西,但它是错误的或在错误的地方,并且您的节点以默认值开始并且该值(最小 256MB,最大 1GB)是不够的
  3. putting too much data because of very heavy indexing, for example a bulk size that's way too large由于非常繁重的索引而放置了太多数据,例如批量大小太大
  4. querying using a very large (depends on how much memory you have, but a 2 billion will surely bring the cluster down) "size"使用非常大的查询(取决于您拥有多少内存,但 20 亿肯定会使集群下降) "size"
  5. especially for master nodes (master eligible nodes) that don't have enough memory - the cluster state is a likely culprit.特别是对于没有足够内存的主节点(符合主节点的节点)——集群状态可能是罪魁祸首。 The cluster state can get very large if there are a lot of aliases defined for each index.如果为每个索引定义了很多别名,则集群状态可能会变得非常大。

An OOMed node needs to be restarted, btw.需要重新启动 OOMed 节点,顺便说一句。

I can't speak to your question directly, but there are a couple of approaches to this type of problem that I've found useful in the past:我无法直接回答您的问题,但我过去发现有几种方法可以解决此类问题:

  1. Use JVisualVM to inspect the contents of the heap.使用 JVisualVM 检查堆的内容。 JVisualVM is a free tool that's shipped with the JDK. JVisualVM 是 JDK 附带的免费工具。 It lets you inspect details of running JVMs, including a full dump of the heap.它允许您检查运行 JVM 的详细信息,包括堆的完整转储。

  2. If you suspect the error is simply due to the JVM not having enough memory available, you can increase it manually via heap parametersreference .如果您怀疑错误仅仅是由于 JVM 没有足够的可用内存,您可以通过堆参数参考手动增加它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM