Skip to content

Potential memory leak #97

@efoncubierta

Description

@efoncubierta

If you create a SwiftClient with a token, a new listener will be added added to OpenStack.CLIENT.listeners collection for every call to SwiftClient.execute. This listener is never popped out the collection and, therefore, a garbage collector or heap space exception will raise eventually.

public class SwiftClient extends AbstractOpenStackClient {

    public SwiftClient(String endpointURL, String token) {
        super(endpointURL, token);
    }

    public <R> R execute(SwiftCommand<R> command) {
        WebTarget endpoint = OpenStack.CLIENT.target(endpointURL);
        if(token != null) {
            endpoint.register(tokenFilter);
        }
        return command.execute(endpoint);
    }

}

There is no way to remove the listener once it has been added. The only available option is to create a new JerseyClient.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions