1

Issue Description: We are facing the following issue in a web application (on 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

The issue is that the memory consumed by cq5 java process (which runs the servlet engine) keeps on increasing with time. Once it reaches above 6 to 6.5 GB (and system memory reaches 7 GB), the JVM stops responding. (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. 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). 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.

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.
Apoorve
  • 165
  • 3
  • 9
  • 1
    I guess [valgrind](http://valgrind.org) is your friend. – maaartinus May 15 '14 at 12:42
  • Consider profiling your application or using JFR: http://stackoverflow.com/questions/1207802/performance-cost-of-profiling-a-web-application-in-production/23377547#23377547 – Alexey Malev May 15 '14 at 21:39
  • Check cache configuration - runaway memory usage could be do to missing entry invalidation calls or excessive TTL. – Java42 May 15 '14 at 23:10
  • See http://stackoverflow.com/questions/26041117/growing-resident-memory-usage-rss-of-java-process – Lari Hotari Aug 25 '16 at 11:52

1 Answers1

0

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. It's actually a memory leak down in one of the Java libraries that powers the Image Servlet, way down under the covers. It's remedied by a Java version update, but it's caused by the Image servlet. Kind of a long shot that it's your issue, but probably worth mentioning.

ryanlunka
  • 236
  • 1
  • 8
  • Thanks ryanlunka. We have already checked JPEGImage Servlet and thats not the issue. Actually in heap there is no issue. Its just that the resident memory of java process keeps on increasing. – Apoorve May 20 '14 at 03:45
  • Do you have any idea on how to profile or analyze process memory (other than heap, code cache and permgen)? I looked at /proc/pid/smaps and /proc/pid/maps in unix but they dont give enough details. – Apoorve May 20 '14 at 03:47