简体   繁体   English

Java进程(非堆)内存泄漏

[英]Java process (Non-Heap) Memory Leak

Issue Description: We are facing the following issue in a web application (on CQ5): 问题说明:我们在Web应用程序中(在CQ5上)面临以下问题:

System Configurations details: • System memory: 7GB • Xmx: 3.5 GB • Xms: 1 GB • MaxPermGen: 300MB • Max no of observed threads: 620 (including 300 http request serving threads) • Xss: default 系统配置详细信息:•系统内存:7GB•Xmx:3.5 GB•Xms:1 GB•MaxPermGen:300MB•观察到的最大线程数:620(包括300个HTTP请求服务线程)•Xss:默认

The issue is that the memory consumed by cq5 java process (which runs the servlet engine) keeps on increasing with time. 问题是cq5 java进程(运行servlet引擎)消耗的内存随着时间的推移而不断增加。 Once it reaches above 6 to 6.5 GB (and system memory reaches 7 GB), the JVM stops responding. 一旦达到6至6.5 GB以上(并且系统内存达到7 GB),JVM就会停止响应。 (due to shortage of memory and heavy paging activity). (由于内存不足和大量的分页活动)。 The heap and permgen however collectively remain at or below 3.8 (3.5+0.3) GB. 但是,堆和permgen总计保持在3.8(3.5 + 0.3)GB或以下。 This means that non heap memory (native memory + thread stack space) keeps growing from a few 100 MBs (after CQ5 server restart) to more than 2-3 GBs (after long runs 4-5 hrs with heavy loads). 这意味着非堆内存(本机内存+线程堆栈空间)一直从几百MB(在CQ5服务器重新启动后)增长到超过2-3 GB(在长期运行4-5个小时后承受重负载)。 So our goal is basically to find out the memory leaks in non-heap memory which could be introduced due to 3rd party libraries, indirect references of Java code etc. We are not receiving any out of memory errors. 因此,我们的目标基本上是找出非堆内存中的内存泄漏,这可能是由于第三方库,Java代码的间接引用等导致的。 我们没有收到任何内存不足错误。

Help needed: 需要帮助:

  • Now most of the tools we used are giving us good information and details about heap memory. 现在,我们使用的大多数工具都为我们提供了有关堆内存的良好信息和详细信息。 But we are unable to get a view to native memory. 但是我们无法查看本机内存。 Request to provide your valuable suggestions on how to monitor non heap memory details (at object level or at memory area level). 请求提供有关如何监视非堆内存详细信息(在对象级别或在内存区域级别)的宝贵建议。
  • If anyone of you have faced a similar issue (non-heap memory leak) in any of your applications, and would like to share knowledge about how to fix non heap memory leaks, request you to share your experience. 如果您中的任何人在任何应用程序中都遇到了类似的问题(非堆内存泄漏),并且想分享有关如何解决非堆内存泄漏的知识,请要求您分享经验。

This is really dependent on your specific implementation: what code you've deployed, what infrastructure you're using, what version you're running, what application servers (if any) you're using, etc. 这实际上取决于您的特定实现:已部署的代码,正在使用的基础结构,正在运行的版本,正在使用的应用程序服务器(如果有)等。

That said, I have experienced memory leak issues with CQ5.5 and the Image Servlet. 也就是说,我遇到了CQ5.5和Image Servlet的内存泄漏问题。 It's actually a memory leak down in one of the Java libraries that powers the Image Servlet, way down under the covers. 实际上,这是为Image Servlet供电的Java库之一中的内存泄漏,其背后是隐藏的。 It's remedied by a Java version update, but it's caused by the Image servlet. 它是通过Java版本更新补救的,但是是由Image servlet引起的。 Kind of a long shot that it's your issue, but probably worth mentioning. 从长远来看,这是您的问题,但可能值得一提。

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

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