Solr 使用太多内存 [英] Solr uses too much memory

查看:33
本文介绍了Solr 使用太多内存的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有一个在 Windows 2008 R2 上运行的 Solr 3.4 实例,其中 Oracle Java 6 Hotspot JDK 变得无响应.当我们查看机器时,我们注意到可用物理内存变为零.

We have a Solr 3.4 instance running on Windows 2008 R2 with Oracle Java 6 Hotspot JDK that becomes unresponsive. When we looked at the machine, we noticed that the available physical memory went to zero.

Tomcat7.exe 进程正在使用 ~70Gigs(私有工作集),但工作集(内存)正在使用系统上的所有内存.Tomcat/Solr 日志中没有错误.我们使用 VMMap 来识别内存用于映射 Solr 段文件.

The Tomcat7.exe process was using ~70Gigs (Private Working Set) but Working Set (Memory) was using all the memory on the system. There were no errors in the Tomcat / Solr logs. We used VMMap to identify that the memory was being used for memory mapping the Solr segement files.

重启Tomcat暂时解决了这个问题,但最终又回来了.

Restarting Tomcat fixed the problem temporarily, but it eventually came back.

然后我们尝试减小 JVM 大小以为内存映射文件提供更多空间,但随后 Solr 最终变得无响应,年老代为 100%.再次重置修复了问题,但在我们重置之前并没有抛出内存不足异常.

We then tried decreasing the JVM size to give more space for the memory mapped files, but then the Solr eventually becomes unresponsive with the old generation at 100%. Again resetting fixed the problem, but it did not throw an out-of-memory exception before we reset.

目前我们的蜘蛛侠感觉告诉我们,当存在内存压力时缓存不会收缩,并且可能有太多的 MappedByteBuffers 挂在周围,以至于操作系统无法从内存映射文件中释放内存.

Currently our spidey sense is telling us that the cache doesn't shrink when there is memory pressure, and that maybe there are too many MappedByteBuffers hanging around so that the OS can not free up the memory from memory mapped files.

推荐答案

参数太多,信息太少,无法帮助解决任何细节问题.与上述系统一样,这个答案也很旧.

There are too many parameters and too little information to help with any details. This answer is also quite old as are the mentioned systems.

以下是一些对我有帮助的事情:

Here are some things that helped in my experience:

  • 而是减少 Tomcat 和 SOLR 中的 RAM 使用量,以降低交换的风险.为系统留出喘息的空间.
  • 如果这开始"出现而没有对 Tomcat 或 SOLR 配置进行任何更改 - 可能是因为 SOLR 必须索引和查询的数据量增加了.这可能意味着原始配置一开始就不好,或者已经达到当前资源的限制并且必须进行审查.是哪个?
  • 检查查询(如果您可以影响它们):将经常被请求的任何子查询构造移动到过滤查询中,将非常个别的请求构造移动到常规查询参数中.减少查询缓存,增加/保持过滤器查询缓存 - 或者减少过滤器缓存,以防过滤器查询在您的系统中使用不多.
  • 检查 SOLR 的 schema.xml 是否存在配置错误(实际上可能只是误解).我遇到过一次:在导入字段时会大量创建,导致 RAM 溢出.
  • 如果在导入期间发生:检查导入过程是否设置为自动提交并经常提交,并且还进行了优化 - 也许可以减少提交的频率并在最后只优化一次.
  • 升级 Java、Tomcat 和 SOLR

这篇关于Solr 使用太多内存的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆