[ 
https://issues.apache.org/jira/browse/CAMEL-13781?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16892052#comment-16892052
 ] 

MOHAMMED SOHAIB edited comment on CAMEL-13781 at 7/24/19 6:04 PM:
------------------------------------------------------------------

Here is the highlighted sample code which is causing the memory leak,
=================================================================

public void process(Exchange exchange) throws Exception {
                try {
        {color:red}{color:#d04437}              UpdateBpdVariables originalData 
= exchange.getIn().getBody(UpdateBpdVariables.class);
{color}{color}
                        logger.debug("UpdateProcessVariablesProcessor gotten 
movement info: " + originalData.getMovementNumber() + " " +
                                        originalData.getPaymentLevel() + " " + 
originalData.getAgentCode() + " " + originalData.getAgentType() + " " + 
                                        originalData.getPaidToDate() + " " + 
originalData.getMovementPriority());
                        
                        // Assign parameters into ObjectNode
                        ObjectNode node = objMapper.createObjectNode();
                        if (StringUtils.isNotEmpty(originalData.getSvType()))
                                node.put("svType", originalData.getSvType());
                        node.put("redType", originalData.getRedType());
                        node.put("mdrtType", originalData.getMdrtType());
                        node.put("eliteType", originalData.getEliteType());
                        node.put("agentCode", originalData.getAgentCode());
                        node.put("clientCode", originalData.getClientCode());
                        node.put("agentType", originalData.getAgentType());
                        node.put("backScanDate", 
originalData.getBackScanDate());
                        node.put("firstDocReceivedDate", 
originalData.getFirstDocReceivedDate());
                        if (!StringUtils.isEmpty(originalData.getCaseType()))
                                node.put("caseType", 
originalData.getCaseType());
                        node.put("addressStatus", 
originalData.getAddressStatus());
                        
                        logger.debug("UpdateProcessVariablesProcessor 
parameters1: " + node.toString());
                        if 
(StringUtils.isNotEmpty(originalData.getFirstDocReceivedDateDate()))
                                node.put("firstDocReceivedDateDate", 
originalData.getFirstDocReceivedDateDate());
                        node.put("paidToDate", originalData.getPaidToDate());
                        node.put("bankrupt", originalData.getBankrupt());
                        if 
(StringUtils.isNotEmpty(originalData.getPaidToDateDate()))
                                node.put("paidToDateDate", 
originalData.getPaidToDateDate());

                        if (StringUtils.isNotEmpty(originalData.getSvType())) {
                                if 
("Y".equalsIgnoreCase(originalData.getSvType()))
                                        node.put("signVerification", "Pass");
                                else if 
("N".equalsIgnoreCase(originalData.getSvType()))
                                        node.put("signVerification", "Failed");
                                else
                                        node.put("signVerification", 
originalData.getSvType());
                        }
                        
                if (StringUtils.isNotEmpty(originalData.getSysValidation())) {
                                if 
("Y".equalsIgnoreCase(originalData.getSysValidation()))
                                        node.put("sysValidation", "Pass");
                                else if 
("N".equalsIgnoreCase(originalData.getSysValidation()))
                                        node.put("sysValidation", "Failed");
                                else
                                        node.put("sysValidation", 
originalData.getSysValidation());
                        }
                        
                        node.put("overDueDays", originalData.getOverdueDays());
                        node.put("TAT", originalData.getTat());
                        node.put("movementDoneDate", 
originalData.getMovementDoneDate());
                        
                        logger.debug("UpdateProcessVariablesProcessor 
parameters2: " + node.toString());
                        
                        exchange.getIn().setBody(node.toString());              
        
                        
                        {color:#d04437}_Map<String,Object> headers = new 
HashMap<String,Object>();
                        headers.put("processInstance_ID", 
originalData.getPiid());
                        exchange.getIn().setHeaders(headers);
        _{color}        } catch (Exception e) {
                        // Log Error Message here
                        logger.error("Exception occured in 
UpdateProcessVariablesProcessor : ", e);
                        e.printStackTrace();
                }



was (Author: mdshohaib):
Here is the highlighted sample code which is causing the memory leak,
=================================================================

public void process(Exchange exchange) throws Exception {
                try {
        {color:red}{color:#d04437}              UpdateBpdVariables originalData 
= exchange.getIn().getBody(UpdateBpdVariables.class);
{color}{color}
                        logger.debug("UpdateProcessVariablesProcessor gotten 
movement info: " + originalData.getMovementNumber() + " " +
                                        originalData.getPaymentLevel() + " " + 
originalData.getAgentCode() + " " + originalData.getAgentType() + " " + 
                                        originalData.getPaidToDate() + " " + 
originalData.getMovementPriority());
                        
                        // Assign parameters into ObjectNode
                        ObjectNode node = objMapper.createObjectNode();
                        if (StringUtils.isNotEmpty(originalData.getSvType()))
                                node.put("svType", originalData.getSvType());
                        node.put("redType", originalData.getRedType());
                        node.put("mdrtType", originalData.getMdrtType());
                        node.put("eliteType", originalData.getEliteType());
                        node.put("agentCode", originalData.getAgentCode());
                        node.put("clientCode", originalData.getClientCode());
                        node.put("agentType", originalData.getAgentType());
                        node.put("backScanDate", 
originalData.getBackScanDate());
                        node.put("firstDocReceivedDate", 
originalData.getFirstDocReceivedDate());
                        if (!StringUtils.isEmpty(originalData.getCaseType()))
                                node.put("caseType", 
originalData.getCaseType());
                        node.put("addressStatus", 
originalData.getAddressStatus());
                        
                        logger.debug("UpdateProcessVariablesProcessor 
parameters1: " + node.toString());
                        if 
(StringUtils.isNotEmpty(originalData.getFirstDocReceivedDateDate()))
                                node.put("firstDocReceivedDateDate", 
originalData.getFirstDocReceivedDateDate());
                        node.put("paidToDate", originalData.getPaidToDate());
                        node.put("bankrupt", originalData.getBankrupt());
                        if 
(StringUtils.isNotEmpty(originalData.getPaidToDateDate()))
                                node.put("paidToDateDate", 
originalData.getPaidToDateDate());

                        if (StringUtils.isNotEmpty(originalData.getSvType())) {
                                if 
("Y".equalsIgnoreCase(originalData.getSvType()))
                                        node.put("signVerification", "Pass");
                                else if 
("N".equalsIgnoreCase(originalData.getSvType()))
                                        node.put("signVerification", "Failed");
                                else
                                        node.put("signVerification", 
originalData.getSvType());
                        }
                        
                if (StringUtils.isNotEmpty(originalData.getSysValidation())) {
                                if 
("Y".equalsIgnoreCase(originalData.getSysValidation()))
                                        node.put("sysValidation", "Pass");
                                else if 
("N".equalsIgnoreCase(originalData.getSysValidation()))
                                        node.put("sysValidation", "Failed");
                                else
                                        node.put("sysValidation", 
originalData.getSysValidation());
                        }
                        
                        node.put("overDueDays", originalData.getOverdueDays());
                        node.put("TAT", originalData.getTat());
                        node.put("movementDoneDate", 
originalData.getMovementDoneDate());
                        
                        logger.debug("UpdateProcessVariablesProcessor 
parameters2: " + node.toString());
                        
                        exchange.getIn().setBody(node.toString());              
        
                        
                        {color:#d04437}{color:#d04437}Map<String,Object> 
headers = new HashMap<String,Object>();
                        headers.put("processInstance_ID", 
originalData.getPiid());
                        exchange.getIn().setHeaders(headers);{color}
        {color} } catch (Exception e) {
                        // Log Error Message here
                        logger.error("Exception occured in 
UpdateProcessVariablesProcessor : ", e);
                        e.printStackTrace();
                }


> Production Memory Leakage Issue
> -------------------------------
>
>                 Key: CAMEL-13781
>                 URL: https://issues.apache.org/jira/browse/CAMEL-13781
>             Project: Camel
>          Issue Type: Bug
>          Components: came-core
>    Affects Versions: 2.17.7
>         Environment: Production
>            Reporter: MOHAMMED SOHAIB
>            Priority: Critical
>         Attachments: Code_Snippet_2.png, Code_snippet_1.png, Pie Chart.png, 
> Problem_Describtion.png, Suspect_Problem.png
>
>
> Dear Team,
> There is frequent memory leakage problem on production WAS server and We have 
> analyzed the heap dump, thread dumps and garbage collection logs and below 
> are the Observations from our analysis.
> We observed the memory leakage problem with the below package,
> *org/apache/camel/com/googlecode/concurrentlinkedhashmap/ConcurrentLinkedHashMap*
>  
> The memory leakage might be happening in the camel jar file 
> *"camel-core-2.17.7.jar"* as per the leakage suspect analysis which is used 
> in our custom application name "RestWebServices"
> +*Below are the observations from the logs analysis.*+
> *+Leak suspect 1.+*
>  1,403,578,672 bytes (53.36 %) of Java heap is used by 254 instances of 
> java/util/HashMap$Entry
>  Contains an instance) of the leak suspect:
>  - 
> org/apache/camel/com/googlecode/concurrentlinkedhashmap/ConcurrentLinkedHashMap$Node
>  holding 228,815,984 bytes at 0x71fb89c88
>  
>  *+Leak Suspect 2.+* 
> 977,860,416 bytes (37.17 %) of Java heap is used by 9,682 instances of 
> org/apache/http/impl/conn/PoolingHttpClientConnectionManager
> *+Leak suspect 3.+*
> A Linked List Data Structure Detected.
> 228,816,192 bytes (8.7 %) of Java heap is used by 759 instances of 
> org/apache/camel/com/googlecode/concurrentlinkedhashmap/ConcurrentLinkedHashMap$Node
> Contains 2 types of the following objects:
> - 759 instances of java/lang/String holding 139,656 bytes
> - 759 instances of 
> org/apache/camel/com/googlecode/concurrentlinkedhashmap/ConcurrentLinkedHashMap$WeightedValue
>  holding 228,658,112 bytes
> -Contained under array of java/util/HashMap$Entry holding 1,403,578,672 bytes 
> at 0x70e6cd110
> ========================================================
>  
> Kindly review this problem and suggest possible solutions as soon as possible.
>  
> Regards,
> Md Sohaib.
>  



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)

Reply via email to