How to solve Memory Leak issue in alfresco 5.2?

cancel
Showing results for 
Search instead for 
Did you mean: 
faizrahk
Active Member II

How to solve Memory Leak issue in alfresco 5.2?

Jump to solution

Hi,

Iam facing memory leak issue in alfresco 5.2, Can any one tell what is the common reason for memory leak in alfresco 5.2 and how to solve it.

we have 64gb of ram in our windows server. and 60gb memory is being consumed. and shows 95% memory utilization and suddenly db connection will get depleted and i have to restart the services again and again. this happens every day.

just for information we have enabled ldap configuration for two ous.

Kindly help.

1 Solution

Accepted Solutions
afaust
Master

Re: How to solve Memory Leak issue in alfresco 5.2?

Jump to solution

I do not understand why people increase their Xmx/Xms settings to insane levels without understanding their Java process memory use. As you can see from the analysis of your memory dump, the entire heap usage is only around 800M. That means by setting heap to 30G you effectively assign about 37x the memory than you are using. By reducing the excessively large values for Xmx/Xms to a more reasonable 8G for example (unless you absolutely are sure that you have peaks where you need more), you should be able to reduce the overal memory utilization.

I also bet that if you were to check via the Windows task manager, it would show a resident working set for the Java process around 40G or so, far from the 95% utilization. The 95% utilization is the full total of all processes on the Windows host. So you should also look for other services / tasks running on the Windows host that may consume a significant bit of memory.

View solution in original post

9 Replies
angelborroy
Alfresco Employee

Re: How to solve Memory Leak issue in alfresco 5.2?

Jump to solution

You can start by examining a Thread Dump when your server is busy.

This will tell you what Java process are running.

Hyland Developer Evangelist
afaust
Master

Re: How to solve Memory Leak issue in alfresco 5.2?

Jump to solution

First you should try to differentiate which process is actually taking the memory. You say 60 GiB of memory is used on your Windows server, but not which process is actually using what amount of memory. So go to your task manager and identify which specific service / task has a large resident set / memory usage. If that service / task is not a Java process, then the memory leak is actually not "in" Alfresco, but some 3rd-party component either bundled by Alfresco or actually part of the operating system.

Also please provide your Alfresco / Tomcat Java process parameters, e.g. anything that relates to the Xms / Xmx parameters. Typically, the Alfresco process will be configured with a set range of min/max memory size and would not be allowed to grow indefinitely.

faizrahk
Active Member II

Re: How to solve Memory Leak issue in alfresco 5.2?

Jump to solution

Hi,

I have configured both min and max heap size as 16gb. No other processes are consuming more memory except alfrescotomcat. and if we increase maximum heap size to 30GB then it will consume all of 30GB memory and memory consumption shows more than 93% when we see in task manager.

please find the heap dump screen shot attachments generated. Kindly help

afaust
Master

Re: How to solve Memory Leak issue in alfresco 5.2?

Jump to solution

I do not understand why people increase their Xmx/Xms settings to insane levels without understanding their Java process memory use. As you can see from the analysis of your memory dump, the entire heap usage is only around 800M. That means by setting heap to 30G you effectively assign about 37x the memory than you are using. By reducing the excessively large values for Xmx/Xms to a more reasonable 8G for example (unless you absolutely are sure that you have peaks where you need more), you should be able to reduce the overal memory utilization.

I also bet that if you were to check via the Windows task manager, it would show a resident working set for the Java process around 40G or so, far from the 95% utilization. The 95% utilization is the full total of all processes on the Windows host. So you should also look for other services / tasks running on the Windows host that may consume a significant bit of memory.

lcolorado
Partner

Re: How to solve Memory Leak issue in alfresco 5.2?

Jump to solution

Hello Faiz,

Unfortunately the information that you are providing is not very useful because it was probably obtained shortly after restarting Alfresco. What you want to get is a memory dump when the memory is getting full, so you can see what kind object is using up the memory. 

I am also observing a possible memory leak on an Alfresco 5.2, but it's not clear what is causing it. I had not seen memory leaks since Alfresco 4.2, and Google seems to confirm it. I'm looking forward to your new report. I'll share my findings if anything comes up on my side.

Thanks,

Luis

faizrahk
Active Member II

Re: How to solve Memory Leak issue in alfresco 5.2?

Jump to solution

Hi,

I'am not able to figure out what is the problem, Even after setting low Xms and XMx im facing the same issue. and none of the other processes are consuming much of the memory. We are using dedicated windows server.

Is it because of the Active directory synchronization(using default synchronization time) or the document transformation/rendition problem? Because in the log files i could see only warning and errors regarding ldap synchronization and document rendition.

Since i have noticed that few people are also facing this issue so It would be better if Alfresco Developer team can provide spring boot actuator kind of functionality with hal browser. So that it will become very easy to monitor and trace our application. with the heap dump  its very hard and confusing to make out whats going on behind the scenes.

Kindly help.

afaust
Master

Re: How to solve Memory Leak issue in alfresco 5.2?

Jump to solution

Spring Boot Actuator cannot give you anymore information than what you would be able to gleam from a heap dump.

Have you checked your Windows service configuration? In another thread where somebody has a memory issue, I have the sneaking suspiciion they are simply setting their memory configs in all the wrong places which are not picked up when running as a Windows service.

faizrahk
Active Member II

Re: How to solve Memory Leak issue in alfresco 5.2?

Jump to solution

I have set the heap size using alfrescoTomcatw.exe windows service only which is present in tomcat/bin directory.

That is true but i can able to find out metrics and other components in memory easily. I dont know how to analyze memory using Eclipse memory analyzer or any other heap dump analyzing tools.

faizrahk
Active Member II

Re: How to solve Memory Leak issue in alfresco 5.2?

Jump to solution

Thank you very much for the help

I had kept for observation with 2gb as initial memory pool and 8gb maximum memory pool, iam able to solve Memory consumption issue.

Before i was trying with 4gb and 12gb settings, it was giving the same problem after a day or two.

Regards.