users@jersey.java.net

memory leak with CDI ?

From: satish gopalakrishnan <satish99_at_gmail.com>
Date: Fri, 23 Jul 2010 23:45:44 -0400

Hi,
I am using glassfish v 3.01. I have the simplest of applications - a hello
world resource and a helloService which is empty. When I access it
repeatedly using just wget, after a while I see that the memory usage keeps
increasing - basically a memory leak. Here is the code


@Path("/hello")
@RequestScoped
public class HelloWorldResource {

    @Inject
    HelloService helloService;
    public String helloWorldTest(){
        helloService.toString();
        return "xyz"
    }
}

Am I doing something wrong here ? This is the simplest possible application
with CDI and jersey - so somewhat surprised that this can have a memory
leak. I tried @managedBean as well. Same result.

My web.xml looks like this

<servlet-class>com.sun.jersey.spi.container.servlet.ServletContainer</servlet-class>
<init-param>
<param-name>javax.ws.rs.Application</param-name>
<param-value>mtest.HelloApplication</param-value>
</init-param>
</servlet>


Any help / insights would be greatly appreciated

thanks