You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by ji...@apache.org on 2004/05/14 18:39:56 UTC

[jira] Commented: (AXIS-1270) huge memory leak in axis

The following comment has been added to this issue:

     Author: Davanum Srinivas
    Created: Fri, 14 May 2004 9:39 AM
       Body:
Fredo,

Can you please do me a favor? Can you try the following scenario's since you already have the test environment working.

Scenario #1: DON'T use CommonsHTTPSender and DON'T use HTTPS
Scenario #2: Use CommonsHTTPSender but DON'T use HTTPS

If in Scenario #1, you still get leaks, then it's axis problem. If there are no leaks in #1, but there are leaks in #2, then it's a CommonsHTTPSender problem. You get the picture....Please let me know the results and then i'll jump on it again.

Thanks,
dims

---------------------------------------------------------------------
View this comment:
  http://issues.apache.org/jira/browse/AXIS-1270?page=comments#action_35560

---------------------------------------------------------------------
View the issue:
  http://issues.apache.org/jira/browse/AXIS-1270

Here is an overview of the issue:
---------------------------------------------------------------------
        Key: AXIS-1270
    Summary: huge memory leak in axis
       Type: Bug

     Status: Open
   Priority: Critical

    Project: Axis
   Versions:
             current (nightly)

   Assignee: Davanum Srinivas
   Reporter: Fredo Corleone

    Created: Fri, 26 Mar 2004 1:51 PM
    Updated: Fri, 14 May 2004 9:39 AM
Environment: Solaris 8, java 1.4.1, 1.4.2


Description:
I'm running a simple java program to request stuff from a server and practically request produces a signifcant (~32K) memory leak on Solaris. Both top and ps show that the size of the process is monotonically increasing. OptimizeIt indicate that Strings and char[]s are bieng leaked, but it can't provide info about where they were allocated or reference graphs.
The requests and responses are very small, less than 500 bytes apiece. 
We have code generated from wsdl using wsdl2java, are using commons-httpclient and https.
What follows is a cut&paste if the source code since I don't see a way to attach files on this page. I can provide my wsdl and further info if necessary.
----------my.java-------------------
package com.foo.my;

import java.util.*;
import java.io.*;
import java.net.*;

import mil.army.us.peoc3t.PASS.*;
import mil.army.us.peoc3t.PASS.ports.*;
import mil.army.us.peoc3t.PASS.wsdl.*;

import org.apache.axis.*;
import org.apache.axis.client.Stub;

public class my
{
    public int topicrefreshtime=30000;
    my()
    {
    }
    public static void main(String[] args)
    {
        my m = new my();
        if(args[0] != null)
            m.topicrefreshtime = Integer.parseInt(args[0])*1000;
        m.go();
    }
    private void go()
    {
        try
        {
            System.setProperty("javax.net.ssl.trustStore",
                //"c:\\h\\pcisdk\\data\\truststore");
                "/h/PCI/data/truststore");
        }
        catch (Exception ex)
        {
            System.out.println("Exception setting javax.net.ssl.trustStore=");
                ex.printStackTrace();
        }
        try
        {
            System.setProperty("javax.net.ssl.trustStorePassword", "mitre1");
        }
        catch (Exception ex)
        {
            System.out.println(
                "Exception setting javax.net.ssl.trustStorePassword");
                    ex.printStackTrace();
        }
        AxisProperties.setProperty(
            EngineConfigurationFactory.SYSTEM_PROPERTY_NAME,
            "com.foo.my.PASSEngineConfigurationFactory");

        PASSPortType m_passService = null;
        try
        {
            m_passService = new PASServiceLocator().getPASService(
                new URL("https://134.80.99.231:7778/PASS"));
            Stub stub = (Stub) m_passService;
            stub._setProperty("javax.xml.rpc.security.auth.username",
                "ajd1");
            stub._setProperty("javax.xml.rpc.security.auth.password",
                "pass1");
        }
        catch (Exception e)
        {
            System.out.println("bind failed: " + e.toString());
        }

        _sync syncReq = new _sync();
        syncReq.setCompression(false);
        syncReq.setRequester_id("ajd1");
        syncReq.setTopic("topics");
        while (true)
        {
            try
        {
            System.setProperty("javax.net.ssl.trustStorePassword", "mitre1");
        }
        catch (Exception ex)
        {
            System.out.println(
                "Exception setting javax.net.ssl.trustStorePassword");
                    ex.printStackTrace();
        }
        AxisProperties.setProperty(
            EngineConfigurationFactory.SYSTEM_PROPERTY_NAME,
            "com.foo.my.PASSEngineConfigurationFactory");

        PASSPortType m_passService = null;
        try
        {
            m_passService = new PASServiceLocator().getPASService(
                new URL("https://134.80.99.231:7778/PASS"));
            Stub stub = (Stub) m_passService;
            stub._setProperty("javax.xml.rpc.security.auth.username",
                "ajd1");
            stub._setProperty("javax.xml.rpc.security.auth.password",
                "pass1");
        }
        catch (Exception e)
        {
            System.out.println("bind failed: " + e.toString());
        }

        _sync syncReq = new _sync();
        syncReq.setCompression(false);
        syncReq.setRequester_id("ajd1");
        syncReq.setTopic("topics");
        while (true)
        {
            try
            {
                // Request stuff from the server
                _sync_response sr = m_passService.sync(syncReq);
                System.out.println("Ntopics: " + sr.getCreate_topic().length);
                sr = null;
            }
            catch(Pass_fault e)
            {
                System.out.println("sync for topics fault: " + faultString(e));
                System.out.println(e.getStatus());
            }
            catch(Exception e)
            {
                System.out.println("sync for topics failed: " + e.toString());
                e.printStackTrace();
            }

            try
            {
                System.out.println("sleeping:"+topicrefreshtime);
                Thread.currentThread().sleep(topicrefreshtime);
            }
            catch(InterruptedException e)
            {
            }
        }
    }
    private final static String faultString(Pass_fault fault)
    {
        return("\ndetails-> " +  fault.getError_details() + "\n" +
            statusString(fault.getStatus()));
    }

    private final static String statusString(Status status)
    {
        return("status code-> " + status.getStatus_code() + " status phrase-> "
            + status.getStatus_phrase());
    }
}


---------------------------------------------------------------------
JIRA INFORMATION:
This message is automatically generated by JIRA.

If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa

If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira