Salut,
> -------- Original Message --------
> Subject: [Jean-Francois Arcand's Blog] New Comment Posted to 'Extending the Grizzly HTTP Runtime'
> Date: Mon, 10 Aug 2009 23:52:03 -0700
> From: foo_at_bar.com
> To: Jeanfrancois.Arcand_at_Sun.COM
>
> A new comment has been posted on your blog Jean-Francois Arcand's Blog, on entry #10074 (Extending the Grizzly HTTP Runtime).
>
>
> View this comment: <http://weblogs.java.net/blog/jfarcand/archive/2008/07/extending_the_g.html>
> Edit this comment: <http://weblogs.java.net/mt/mt.cgi?__mode=view&blog_id=258&_type=comment&id=55619>
>
> 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.
Which version of Grizzly are you using? We have made some changes to the
thread pool. Can you send us a thread dump to see where all those
threads comes from?
A+
-- Jeanfrancois
>
> Shawn
> xpan_at_cdmtech.com
>
>
>
> --
> Powered by Movable Type
> Version 3.01D
> http://www.movabletype.org/