killing the memory eaters
I have uploaded the heap dump throug memory analyzer and found the memory eater through
the below steps.
1. Go to the Dominator tree view and from there I went to
2. "Paths from the GC Roots" ...> "without weak and soft references"
Now I am able to view the references with the names of the fields.
So now I am able to view the memory eaters. For example the below one
com.sap.engine.boot.CoreClassLoader @ 0x9ffffffef3709dd0" occupy 57,651,976 (15.71%) bytes
But how can I kill those memory eaters ?? We are working on SAP PI 7.0. Please advise.
Krum Tsvetkov replied
> 1. How can we know what are all these objects and what they do ??
What they do you wan't be able to see. But you can get more information about the classloaders if you have the NetWeaverExtensions installed - see [https://wiki.sdn.sap.com/wiki/display/Java/DownloadtheSAPNetweaverenhancementsfortheEclipseMemoryAnalyzer|https://wiki.sdn.sap.com/wiki/display/Java/DownloadtheSAPNetweaverenhancementsfortheEclipseMemoryAnalyzer]
Then for most of the classloaders you should see names - the names of services, applications, libraries.
> 2. Is there any literature so that we can know what these objects exactly do ??
Can't answer. These are all components running on the server. I guess reading general help may throw some light.
> 3. How can we know howmuch percentage of heap these objects should consume in healthy condition ??
The sizes depend on the way the system is used. The memory used by the EJB container for example will grow with the number of EJBs deployed. The same applies for web container, WebDynpro, etc... I think whay one could do is measure the concrete system/landscape. Observe the GC behaviour (not with MemoryAnalyzer) of the normal system, or take some heap dumps after the system has been used for some time, so that it is in a "warm" state. And then look at the heap dumps to see the consumption.
> 4. Suppose if these objects consumes more heap, how to fix that problem ?? e. class loader used to load different applications, services, etc consumes more memory etc., In this case how to solve the problem ?? Is there any literature which can explain possible problem and the corresponding solutions ??
If there is for example a memory leak, then sooner or later the system will run into an OutOfMemoryError. You can then analyze the produced heap dumps and see where the memory is kept. If it is within an SAP component, then you can use the normal SAP support channels - SAP notes, OSS messages, etc...
If it is in custom coding, then you can use the hints provided by the Memory Analyzer to see where exactly memory is kept and try to fix the problem.
I don't know any universal algorithm for solving problems with memory consumption in general.