I have created an undertow server with a servlet deployment following the methods in the documentation here:

<http://undertow.io/documentation/servlet/deployment.html>

I am now trying to stop the server and the application in the servlet. 

Calling `server.stop()` makes the server unavailable on the specified port, but when I call `server.start()` again, the application is immediately available (if it had been stopped, it would have taken some time to start up again). I can also see that the memory of the server is not freed when calling `server.stop`. I have tried various combinations including calling `deploymentManager.undeploy()` all with the same effect. 

I have searched the documentation for any clues and come up empty. I wonder if anyone else has any clues? Below is the source code in its current state (please note that I am not a Java developer so there will be plenty of garishness):

```
package org.locee;

import io.undertow.Undertow;
import io.undertow.Undertow.Builder;
import io.undertow.Handlers;
import io.undertow.util.Headers;
import io.undertow.servlet.api.DeploymentInfo;
import io.undertow.servlet.api.DeploymentManager;
import io.undertow.server.handlers.PathHandler;
import io.undertow.server.HttpHandler;
import static io.undertow.servlet.Servlets.defaultContainer;

import javax.servlet.ServletException;

public class LoceeUndertowServer {
    private DeploymentManager deploymentManager;
    private Undertow          undertowServer;
    private DeploymentInfo    servletInfo;
    private int               port;
    private String            host;

    public LoceeUndertowServer( DeploymentInfo servletInfo, int port, String host ) {
        this.servletInfo = servletInfo;
        this.port        = port;
        this.host        = host;
    }

    public void start() throws ServletException {
        deploymentManager = defaultContainer().addDeployment( servletInfo );
        deploymentManager.deploy();

        HttpHandler httpHandler = deploymentManager.start();
        PathHandler pathHandler = Handlers.path( Handlers.redirect( "/" ) ).addPrefixPath( "/", httpHandler );
        Builder     builder     = Undertow.builder();

        builder.addHttpListener( port, host );
        builder.setHandler( pathHandler );

        undertowServer = builder.build();
        undertowServer.start();
    }

    public void shutdown() throws ServletException {
        deploymentManager.undeploy();
        defaultContainer().removeDeployment( servletInfo );
        undertowServer.stop();
    }

    public void restart() throws ServletException {
        shutdown();
        start();
    }
}

```