Issue Details (XML | Word | Printable)

Key: AXIS-2505
Type: Bug Bug
Status: Open Open
Priority: Minor Minor
Assignee: Unassigned
Reporter: Christopher Sahnwaldt
Votes: 0
Watchers: 2
Operations

If you were logged in you would be able to see more operations.
Axis

memory leak in wsdl generation

Created: 20/Jun/06 01:50 AM   Updated: 24/Apr/07 12:33 PM
Return to search
Component/s: WSDL processing
Affects Version/s: current (nightly)
Fix Version/s: None

Time Tracking:
Not Specified


 Description  « Hide
There's a memory leak in org.apache.axis.description.JavaServiceDesc.setDefaultNamespace():
the method adds the given namespace to an ArrayList. This method is called from
org.apache.axis.wsdl.fromJava.Emitter.init(), which in turn is called from
org.apache.axis.providers.BasicProvider.generateWSDL() each time wsdl is generated for a service,
i.e. whenever .../ServiceName?wsdl is invoked.

To reproduce start an Axis server in a debugger, invoke ...?wsdl from a browser a couple of times for
a certain service, and check the instance variable namespaceMappings in the JavaServiceDesc
for that service. It grows by one element each time the wsdl is generated.

A simple (if not very elegant) fix would be to simply remove the namespace before adding it to the list again. If it's not present, nothing happens; if it is, it's moved to the first slot:

public void setDefaultNamespace(String namespace) {
    if (namespaceMappings == null)
        namespaceMappings = new ArrayList();
    namespaceMappings.remove(namespace);
    namespaceMappings.add(0, namespace);
}


 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
No work has yet been logged on this issue.