Hi Fady, On Thu, Aug 17, 2017 at 12:16 PM, Fady Haikal <fadyhai...@gmail.com> wrote: > @Suvendu, > I took a heap dump from Java VisualVM but honestly i didnt know how i > should analyse it, please some help here
Acquire the software: André has already given you some pointer. My favorite is Eclipse MAT[http://www.eclipse.org/mat]. :) - Download the standalone version. - To open a large dump, you need to have a server with sufficient amount of memory. I assume you have such machine. :) - Backup MemoryAnalyzer.ini. Then Remove everything inside it and add following in two lines...make sure there is no space before and after those args: -vmargs -Xmx14g It will create a VM for MAT with 14GB heap. For me it opens up 6GB heap in 5-8min. Adjust heap size as required. Analysis: You need to change Memory Look at the object size in 'Dominator Tree' view(by looking at the Retained and Shallow Heap Size) and use 'path to GC root' option to see what is keeping them alive. If MAT shows that small number of objects are consuming most of the heap, then you are lucky. If very small objects are filling up the heap then your job will become tedious. There is one 'Leak Suspect' view but it may or may not be accurate - depending on your application architecture. I will strongly suggest that you go through some documentation and how to use MAT stuffs so that you become more familiar with it : http://www.eclipse.org/mat/documentation There are lots of docs available over Internet to help you in analysis part. > also please find below the java configuration i used: > -XX:PermSize=10240m > -XX:MaxPermSize=10240m > -XX:ReservedCodeCacheSize=512m > -XX:+UseParNewGC > -XX:+UseConcMarkSweepGC > -XX:+CMSParallelRemarkEnabled > -XX:TargetSurvivorRatio=90 > > Initial and Max Memory Pool: 100000MB > > Regards, > Fady > So you have created a huge JVM. This is the high level formula I use to predict approximate JVM process size: JDK 1.7 JVM Process Size = [-Xmx] + [-XX:MaxPermSize] + [-Xss] * number_of_threads + JIT’ed code + GC + Other Stuffs In your case, from above parameter, (max)approximate size could be 100000MB+10240MB+some more memory. Because I do not know how many threads you have opened. By default I guess JDK 1.7 allocates 1MB stack space per thread. Again, I will suggest to enable NMT if possible. It tells us where most of the memory is being consumed which you can not trace using heap dumps. You are using CMS. I have seen that it can create problem if it is not properly tuned. I hope you have came up with those GC params after good amount of performance testing. One last thing, I agree with André, most probably you are dealing with JVM problem not Tomcat. Please keep us posted about your findings. Thanks! --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org