[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [jetty-users] Question about Jetty threadpool
|
You might better use some kind of Cache with expiration or some kind of
pooling instead of thread locals. That way you can better control and
tune behaviour without having to rely on special notification features.
e.g. with Google Guava Caches you can have a LoadingCache<Thread,
AQMPChannel> with expiration (e.g. 5 Minutes) thatis close to you
current ThreadLocal solution and you will be notified about removals.
Am 12.03.2015 15:18, schrieb Shouvik Bardhan:
Apologies if this has been discussed but I could not find relevant
info with usual google searches.
I have jetty thread pool with a min value of 10 and max of 40. When
the idle timeout kicks in after the end of a busy session and the
threads are killed off, is there a way to get notification about these
threads finishing? I am using Jetty 9 embedded. The reason for asking
is that I have an AQMP channel in thread local (I dont want to create
and close it with every request) and when the threads die, if I dont
close the channel in the threadlocal, naturally there is leak. Since
my app is long running and the AQML connection does not close (off of
which the channel is created), after several hours, we have several
hundred useless channels.
thanks and regards.