users@grizzly.java.net

Re: Improper Thread Count with GWS

From: Shawn Pan <xpan_at_cdmtech.com>
Date: Wed, 30 Sep 2009 08:31:07 -0700

Hi Jeanfrancois,

The problem exists in 1.9.15. Since I switched to 1.9.17, things are
working fine now.

Can you provide me with the link to 1.9.18b?

Thanks, Shawn

On Wed, Sep 30, 2009 at 8:14 AM, Jeanfrancois Arcand
<Jeanfrancois.Arcand_at_sun.com> wrote:
> Salut,
>
> admin_at_java.net wrote:
>>
>> Someone has commented on your post: Extending the Grizzly HTTP Runtime
>> Click
>> here to view it:
>> http://www.java.net/blog/2008/07/03/extending-grizzly-http-runtime
>> java.net
>>
>
>> Hi Jean-Francois, I have a problem with manage threads using Grizzly -- I
>> wrote a http server like follows: GrizzlyWebServer gws = new
>> GrizzlyWebServer(PORT); //set thread number ws.setCoreThreads(100); // Add a
>> GrizzlyAdapter gws.addGrizzlyAdapter(new GrizzlyAdapter() public void
>> service(GrizzlyRequest req, GrizzlyResponse res){ // some computationally
>> intensive code ... ); // Start Web server gws.start(); // Count total
>> thread.... while (true) { Thread.sleep(5000); System.out.println("total
>> threads: " + Thread.getAllStackTraces().size()); } After starting the
>> server, I sent many requests to it and then the server printed out something
>> like: total threads: 56 ... total threads: 145 Even after I close the
>> client, the number of active threads still remain as high as 145 !! Where
>> did I do wrong?! and how do I fix this? Any help is appreciated. Thank you
>> in advance. Shawn xpan_at_cdmtech.com
>
> which version of Grizzly are you using? Can you try 1.9.18b as we did have
> an issue with the Thread count based on the number of core.
>
> Thanks
>
> -- Jeanfrancois
>