Aaron, thank you. That's what I have been trying to find (tracked any and 
all calls to getCache, which can be accessed through 4 different methods 
in our app and I am not seeing anything wrong with the code).

We have 4 hosts in that TomCat instance, I have to find out if a separate 
<Host> in TomCat server.xml implies a separate classloader (it probably 
does) so all the assumptions on JCS being a singleton probably don't work 
-- the number of threads we have would then be 4 times the number of 
regions we have defined... That could be it, I will post an answer as soon 
as I can confirm either way.

What would setting UseMemoryShrinker=false cause for ver. 1.0?

Thanks,
Val




"Smuts, Aaron" <[EMAIL PROTECTED]>
09/07/2005 04:13 PM
Please respond to "JCS Users List"
 
        To:     "JCS Users List" <[email protected]>
        cc: 
        Subject:        RE: ElementEventQueue.QProcessor -- too many 
threads


Turn the memory shrinker off.

jcs.default.cacheattributes.UseMemoryShrinker=false

This might provide some relief.

Try to find out where you get the cache instances.  You might be using
the composite cache manager directly-- the getCache( String regionName )
method.

Aaron

> -----Original Message-----
> From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]
> Sent: Wednesday, September 07, 2005 3:36 PM
> To: JCS Users List
> Subject: RE: ElementEventQueue.QProcessor -- too many threads
>
> Aaron,
>
> Thanks so much for looking into it. This is my first entree into JCS.
I
> suspect there is a bad line of code somewhere in our app which causes
an
> arbitrary region name to be passed to the code which calls out to
> JCS.getInstance (I just can't track that line of code :(
>
> Here is the ccf for what it's worth (it does nto look very clean to
me).
> We have a new thread created every 2-3 minutes, which is why I think
it's
> not exactly the ccf file issue:
> # DEFAULT CACHE REGION
>
> # sets the default aux value for any non configured caches
> jcs.default=
>
jcs.default.cacheattributes=org.apache.jcs.engine.CompositeCacheAttribut
es
> jcs.default.cacheattributes.MaxObjects=100
>
jcs.default.cacheattributes.MemoryCacheName=org.apache.jcs.engine.memory
.l
> ru.LRUMemoryCache
> jcs.default.elementattributes=org.apache.jcs.engine.ElementAttributes
> jcs.default.elementattributes.IsEternal=false
> jcs.default.elementattributes.MaxLifeSeconds=600
> jcs.default.elementattributes.IdleTime=1
> jcs.default.elementattributes.IsSpool=true
> jcs.default.elementattributes.IsRemote=false
> jcs.default.elementattributes.IsLateral=true
> jcs.default.cacheattributes.UseMemoryShrinker=true
> jcs.default.cacheattributes.ShrinkerIntervalSeconds=300
>
>
> # SYSTEM CACHE
>
> # should be defined for the storage of group attribute list
> jcs.system.groupIdCache=
>
jcs.system.groupIdCache.cacheattributes=org.apache.jcs.engine.CompositeC
ac
> heAttributes
> jcs.system.groupIdCache.cacheattributes.MaxObjects=10000
>
jcs.system.groupIdCache.cacheattributes.MemoryCacheName=org.apache.jcs.e
ng
> ine.memory.lru.LRUMemoryCache
>
>
>
> # CACHE REGIONS AVAILABLE
>
> # Regions pre-configured for caching
>
> # Lookup Cache
> jcs.region.lookupCache=
>
jcs.region.lookupCache.cacheattributes=org.apache.jcs.engine.CompositeCa
ch
> eAttributes
> jcs.region.lookupCache.cacheattributes.MaxObjects=100
>
jcs.region.lookupCache.cacheattributes.MemoryCacheName=org.apache.jcs.en
gi
> ne.memory.lru.LRUMemoryCache
>
jcs.region.lookupCache.elementattributes=org.apache.jcs.engine.ElementAt
tr
> ibutes
> jcs.region.lookupCache.elementattributes.IsEternal=false
> jcs.region.lookupCache.elementattributes.MaxLifeSeconds=500000
> jcs.region.lookupCache.elementattributes.IdleTime=1
> jcs.region.lookupCache.elementattributes.IsSpool=true
> jcs.region.lookupCache.elementattributes.IsRemote=true
> jcs.region.lookupCache.elementattributes.IsLateral=true
>
>
>
> # Generic Lookup Cache
> jcs.region.genericLookupCache=
>
jcs.region.genericLookupCache.cacheattributes=org.apache.jcs.engine.Comp
os
> iteCacheAttributes
> jcs.region.genericLookupCache.cacheattributes.MaxObjects=300
>
jcs.region.genericLookupCache.cacheattributes.MemoryCacheName=org.apache
.j
> cs.engine.memory.lru.LRUMemoryCache
>
jcs.region.genericLookupCache.elementattributes=org.apache.jcs.engine.El
em
> entAttributes
> jcs.region.genericLookupCache.elementattributes.IsEternal=false
> # Max life of 14 hours.
> jcs.region.genericLookupCache.elementattributes.MaxLifeSeconds=50400
> jcs.region.genericLookupCache.elementattributes.IdleTime=1
> jcs.region.genericLookupCache.elementattributes.IsSpool=true
> jcs.region.genericLookupCache.elementattributes.IsRemote=true
> jcs.region.genericLookupCache.elementattributes.IsLateral=true
>
>
>
>
> # Vehicle Lookup Cache
> jcs.region.vehicleLookupCache=
>
jcs.region.vehicleLookupCache.cacheattributes=org.apache.jcs.engine.Comp
os
> iteCacheAttributes
> jcs.region.vehicleLookupCache.cacheattributes.MaxObjects=400
>
jcs.region.vehicleLookupCache.cacheattributes.MemoryCacheName=org.apache
.j
> cs.engine.memory.lru.LRUMemoryCache
>
jcs.region.vehicleLookupCache.elementattributes=org.apache.jcs.engine.El
em
> entAttributes
> jcs.region.vehicleLookupCache.elementattributes.IsEternal=false
> # Max life of 2 hours.
> jcs.region.vehicleLookupCache.elementattributes.MaxLifeSeconds=7200
> jcs.region.vehicleLookupCache.elementattributes.IdleTime=1
> jcs.region.vehicleLookupCache.elementattributes.IsSpool=true
> jcs.region.vehicleLookupCache.elementattributes.IsRemote=true
> jcs.region.vehicleLookupCache.elementattributes.IsLateral=true
>
>
>
>
> # Coverage Lookup Cache
> jcs.region.coverageLookupCache=
>
jcs.region.coverageLookupCache.cacheattributes=org.apache.jcs.engine.Com
po
> siteCacheAttributes
> jcs.region.coverageLookupCache.cacheattributes.MaxObjects=200
>
jcs.region.coverageLookupCache.cacheattributes.MemoryCacheName=org.apach
e.
> jcs.engine.memory.lru.LRUMemoryCache
>
jcs.region.coverageLookupCache.elementattributes=org.apache.jcs.engine.E
le
> mentAttributes
> jcs.region.coverageLookupCache.elementattributes.IsEternal=false
> # Max life of 14 hours.
> jcs.region.coverageLookupCache.elementattributes.MaxLifeSeconds=50400
> jcs.region.coverageLookupCache.elementattributes.IdleTime=1
> jcs.region.coverageLookupCache.elementattributes.IsSpool=true
> jcs.region.coverageLookupCache.elementattributes.IsRemote=true
> jcs.region.coverageLookupCache.elementattributes.IsLateral=true
>
>
>
> # Application Key Lookup Cache
> jcs.region.applicationKeyLookupCache=
>
jcs.region.applicationKeyLookupCache.cacheattributes=org.apache.jcs.engi
ne
> .CompositeCacheAttributes
> jcs.region.applicationKeyLookupCache.cacheattributes.MaxObjects=200
>
jcs.region.applicationKeyLookupCache.cacheattributes.MemoryCacheName=org
.a
> pache.jcs.engine.memory.lru.LRUMemoryCache
>
jcs.region.applicationKeyLookupCache.elementattributes=org.apache.jcs.en
gi
> ne.ElementAttributes
> jcs.region.applicationKeyLookupCache.elementattributes.IsEternal=false
> # Max life of 14 hours.
>
jcs.region.applicationKeyLookupCache.elementattributes.MaxLifeSeconds=50
40
> 0
> jcs.region.applicationKeyLookupCache.elementattributes.IdleTime=1
> jcs.region.applicationKeyLookupCache.elementattributes.IsSpool=true
> jcs.region.applicationKeyLookupCache.elementattributes.IsRemote=true
> jcs.region.applicationKeyLookupCache.elementattributes.IsLateral=true
>
>
> # Violation Lookup Cache
> jcs.region.violationLookupCache=
>
jcs.region.violationLookupCache.cacheattributes=org.apache.jcs.engine.Co
mp
> ositeCacheAttributes
> jcs.region.violationLookupCache.cacheattributes.MaxObjects=200
>
jcs.region.violationLookupCache.cacheattributes.MemoryCacheName=org.apac
he
> .jcs.engine.memory.lru.LRUMemoryCache
>
jcs.region.violationLookupCache.elementattributes=org.apache.jcs.engine.
El
> ementAttributes
> jcs.region.violationLookupCache.elementattributes.IsEternal=false
> # Max life of 14 hours.
> jcs.region.violationLookupCache.elementattributes.MaxLifeSeconds=50400
> jcs.region.violationLookupCache.elementattributes.IdleTime=1
> jcs.region.violationLookupCache.elementattributes.IsSpool=true
> jcs.region.violationLookupCache.elementattributes.IsRemote=true
> jcs.region.violationLookupCache.elementattributes.IsLateral=true
>
>
> # Application Hint Lookup Cache
> jcs.region.applicationHintLookupCache=
>
jcs.region.applicationHintLookupCache.cacheattributes=org.apache.jcs.eng
in
> e.CompositeCacheAttributes
> jcs.region.applicationHintLookupCache.cacheattributes.MaxObjects=200
>
jcs.region.applicationHintLookupCache.cacheattributes.MemoryCacheName=or
g.
> apache.jcs.engine.memory.lru.LRUMemoryCache
>
jcs.region.applicationHintLookupCache.elementattributes=org.apache.jcs.e
ng
> ine.ElementAttributes
>
jcs.region.applicationHintLookupCache.elementattributes.IsEternal=false
> # Max life of 14 hours.
>
jcs.region.applicationHintLookupCache.elementattributes.MaxLifeSeconds=5
04
> 00
> jcs.region.applicationHintLookupCache.elementattributes.IdleTime=1
> jcs.region.applicationHintLookupCache.elementattributes.IsSpool=true
> jcs.region.applicationHintLookupCache.elementattributes.IsRemote=true
> jcs.region.applicationHintLookupCache.elementattributes.IsLateral=true
>
>
>
> # Agency Preferences Cache
> jcs.region.agencyPreferencesCache=
>
jcs.region.agencyPreferencesCache.cacheattributes=org.apache.jcs.engine.
Co
> mpositeCacheAttributes
> jcs.region.agencyPreferencesCache.cacheattributes.MaxObjects=500
>
jcs.region.agencyPreferencesCache.cacheattributes.MemoryCacheName=org.ap
ac
> he.jcs.engine.memory.lru.LRUMemoryCache
>
jcs.region.agencyPreferencesCache.elementattributes=org.apache.jcs.engin
e.
> ElementAttributes
> jcs.region.agencyPreferencesCache.elementattributes.IsEternal=false
> # Max life of 14 hours.
>
jcs.region.agencyPreferencesCache.elementattributes.MaxLifeSeconds=50400
> jcs.region.agencyPreferencesCache.elementattributes.IdleTime=1
> jcs.region.agencyPreferencesCache.elementattributes.IsSpool=true
> jcs.region.agencyPreferencesCache.elementattributes.IsRemote=true
> jcs.region.agencyPreferencesCache.elementattributes.IsLateral=true
>
>
> # Agency Products Cache
> jcs.region.agencyProductsCache=
>
jcs.region.agencyProductsCache.cacheattributes=org.apache.jcs.engine.Com
po
> siteCacheAttributes
> jcs.region.agencyProductsCache.cacheattributes.MaxObjects=500
>
jcs.region.agencyProductsCache.cacheattributes.MemoryCacheName=org.apach
e.
> jcs.engine.memory.lru.LRUMemoryCache
>
jcs.region.agencyProductsCache.elementattributes=org.apache.jcs.engine.E
le
> mentAttributes
> jcs.region.agencyProductsCache.elementattributes.IsEternal=false
> # Max life of 14 hours.
> jcs.region.agencyProductsCache.elementattributes.MaxLifeSeconds=50400
> jcs.region.agencyProductsCache.elementattributes.IdleTime=1
> jcs.region.agencyProductsCache.elementattributes.IsSpool=true
> jcs.region.agencyProductsCache.elementattributes.IsRemote=true
> jcs.region.agencyProductsCache.elementattributes.IsLateral=true
>
> # Search Results Cache
> jcs.region.searchResultsCache=
>
jcs.region.searchResultsCache.cacheattributes=org.apache.jcs.engine.Comp
os
> iteCacheAttributes
> jcs.region.searchResultsCache.cacheattributes.MaxObjects=20
>
jcs.region.searchResultsCache.cacheattributes.MemoryCacheName=org.apache
.j
> cs.engine.memory.lru.LRUMemoryCache
>
jcs.region.searchResultsCache.elementattributes=org.apache.jcs.engine.El
em
> entAttributes
> jcs.region.searchResultsCache.elementattributes.IsEternal=false
> jcs.region.searchResultsCache.elementattributes.MaxLifeSeconds=300
> jcs.region.searchResultsCache.elementattributes.IdleTime=1
> jcs.region.searchResultsCache.elementattributes.IsSpool=true
> jcs.region.searchResultsCache.elementattributes.IsRemote=true
> jcs.region.searchResultsCache.elementattributes.IsLateral=true
>
> # Claims Lookup Cache
> jcs.region.ClaimsLookupCache=
>
jcs.region.ClaimsLookupCache.cacheattributes=org.apache.jcs.engine.Compo
si
> teCacheAttributes
> jcs.region.ClaimsLookupCache.cacheattributes.MaxObjects=100
>
jcs.region.ClaimsLookupCache.cacheattributes.MemoryCacheName=org.apache.
jc
> s.engine.memory.lru.LRUMemoryCache
>
jcs.region.ClaimsLookupCache.elementattributes=org.apache.jcs.engine.Ele
me
> ntAttributes
> jcs.region.ClaimsLookupCache.elementattributes.IsEternal=false
> jcs.region.ClaimsLookupCache.elementattributes.MaxLifeSeconds=86400
> jcs.region.ClaimsLookupCache.elementattributes.IdleTime=1
> jcs.region.ClaimsLookupCache.elementattributes.IsSpool=true
> jcs.region.ClaimsLookupCache.elementattributes.IsRemote=true
> jcs.region.ClaimsLookupCache.elementattributes.IsLateral=true
>
>
> #======================================================
> # Cache Regions for TESTING purposes
> #
> # Regions pre-configured for caching junit test scripts.
> #======================================================
>
>
> # Test Cache
> jcs.region.testCache=
>
jcs.region.testCache.cacheattributes=org.apache.jcs.engine.CompositeCach
eA
> ttributes
> jcs.region.testCache.cacheattributes.MaxObjects=100
>
jcs.region.testCache.cacheattributes.MemoryCacheName=org.apache.jcs.engi
ne
> .memory.lru.LRUMemoryCache
>
jcs.region.testCache.elementattributes=org.apache.jcs.engine.ElementAttr
ib
> utes
> jcs.region.testCache.elementattributes.IsEternal=false
> jcs.region.testCache.elementattributes.MaxLifeSeconds=60
> jcs.region.testCache.elementattributes.IdleTime=1
> jcs.region.testCache.elementattributes.IsSpool=true
> jcs.region.testCache.elementattributes.IsRemote=true
> jcs.region.testCache.elementattributes.IsLateral=true
>
> # Scheduled Expire Cache
> jcs.region.scheduleExpireCache=
>
jcs.region.scheduleExpireCache.cacheattributes=org.apache.jcs.engine.Com
po
> siteCacheAttributes
> jcs.region.scheduleExpireCache.cacheattributes.MaxObjects=100
>
jcs.region.scheduleExpireCache.cacheattributes.MemoryCacheName=org.apach
e.
> jcs.engine.memory.lru.LRUMemoryCache
>
jcs.region.scheduleExpireCache.elementattributes=org.apache.jcs.engine.E
le
> mentAttributes
> jcs.region.scheduleExpireCache.elementattributes.IsEternal=false
> jcs.region.scheduleExpireCache.elementattributes.MaxLifeSeconds=50
> jcs.region.scheduleExpireCache.elementattributes.IdleTime=1
> jcs.region.scheduleExpireCache.elementattributes.IsSpool=true
> jcs.region.scheduleExpireCache.elementattributes.IsRemote=true
> jcs.region.scheduleExpireCache.elementattributes.IsLateral=true
>
> jcs.region.scheduleExpireCache.elementattributes.DAY_OF_WEEK = 1,2,5,6
> jcs.region.scheduleExpireCache.elementattributes.HOUR_OF_DAY = 18
> jcs.region.scheduleExpireCache.elementattributes.MINUTE = 00
> jcs.region.scheduleExpireCache.elementattributes.SECOND = 30
> # DELAY=24 hours (24*60*60*1000 ms)
> jcs.region.scheduleExpireCache.elementattributes.DELAY = 86400000
>
>
> # LRU Memory Cache
> jcs.region.memoryCache=
>
jcs.region.memoryCache.cacheattributes=org.apache.jcs.engine.CompositeCa
ch
> eAttributes
> jcs.region.memoryCache.cacheattributes.MaxObjects=100
>
jcs.region.memoryCache.cacheattributes.MemoryCacheName=org.apache.jcs.en
gi
> ne.memory.lru.LRUMemoryCache
>
jcs.region.memoryCache.elementattributes=org.apache.jcs.engine.ElementAt
tr
> ibutes
> jcs.region.memoryCache.elementattributes.IsEternal=false
> jcs.region.memoryCache.elementattributes.MaxLifeSeconds=30
> jcs.region.memoryCache.elementattributes.IdleTime=1
> jcs.region.memoryCache.elementattributes.IsSpool=true
> jcs.region.memoryCache.elementattributes.IsRemote=true
> jcs.region.memoryCache.elementattributes.IsLateral=true
>
> # MRU Memory Cache
> jcs.region.mruMemoryCache=
>
jcs.region.mruMemoryCache.cacheattributes=org.apache.jcs.engine.Composit
eC
> acheAttributes
> jcs.region.mruMemoryCache.cacheattributes.MaxObjects=100
>
jcs.region.mruMemoryCache.cacheattributes.MemoryCacheName=org.apache.jcs
.e
> ngine.memory.mru.MRUMemoryCache
>
jcs.region.mruMemoryCache.elementattributes=org.apache.jcs.engine.Elemen
tA
> ttributes
> jcs.region.mruMemoryCache.elementattributes.IsEternal=false
> jcs.region.mruMemoryCache.elementattributes.MaxLifeSeconds=5
> jcs.region.mruMemoryCache.elementattributes.IdleTime=1
> jcs.region.mruMemoryCache.elementattributes.IsSpool=true
> jcs.region.mruMemoryCache.elementattributes.IsRemote=true
> jcs.region.mruMemoryCache.elementattributes.IsLateral=true
>
> # Disk Cache
> jcs.region.diskCache=DC
>
jcs.region.diskCache.cacheattributes=org.apache.jcs.engine.CompositeCach
eA
> ttributes
> jcs.region.diskCache.cacheattributes.MaxObjects=100
>
jcs.region.diskCache.cacheattributes.MemoryCacheName=org.apache.jcs.engi
ne
> .memory.lru.LRUMemoryCache
>
jcs.region.diskCache.elementattributes=org.apache.jcs.engine.ElementAttr
ib
> utes
> jcs.region.diskCache.elementattributes.IsEternal=false
> jcs.region.diskCache.elementattributes.MaxLifeSeconds=5
> jcs.region.diskCache.elementattributes.IdleTime=1
> jcs.region.diskCache.elementattributes.IsSpool=true
> jcs.region.diskCache.elementattributes.IsRemote=true
> jcs.region.diskCache.elementattributes.IsLateral=true
>
> # AUXILIARY CACHES AVAILABLE
>
> # Primary Disk Cache -- faster than the rest because of memory key
storage
>
jcs.auxiliary.DC=org.apache.jcs.auxiliary.disk.indexed.IndexedDiskCacheF
ac
> tory
>
jcs.auxiliary.DC.attributes=org.apache.jcs.auxiliary.disk.indexed.Indexe
dD
> iskCacheAttributes
> jcs.auxiliary.DC.attributes.DiskPath=webapps/pwp/WEB-INF/cache
>
> # Remote RMI Cache set up to failover
>
jcs.auxiliary.RFailover=org.apache.jcs.auxiliary.remote.RemoteCacheFacto
ry
>
jcs.auxiliary.RFailover.attributes=org.apache.jcs.auxiliary.remote.Remot
eC
> acheAttributes
> jcs.auxiliary.RFailover.attributes.RemoteTypeName=LOCAL
> jcs.auxiliary.RFailover.attributes.FailoverServers=scriptserver:1102
> jcs.auxiliary.RFailover.attributes.GetOnly=false
>
>
>
>
>
>
> "Smuts, Aaron" <[EMAIL PROTECTED]>
> 09/07/2005 02:22 PM
> Please respond to "JCS Users List"
>
>         To:     "JCS Users List" <[email protected]>
>         cc:
>         Subject:        RE: ElementEventQueue.QProcessor -- too many
> threads
>
>
> Adding a region results in event queue creation and on the old model
the
> queues will keep threads around forever.
>
> (You might also be getting some if you have the lateral cache
> configured. )
>
> Send your cache.ccf file or something like it.  I might be able to
> suggest some palliative changes.
>
> > -----Original Message-----
> > From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]
> > Sent: Wednesday, September 07, 2005 1:46 PM
> > To: JCS Users List
> > Subject: RE: ElementEventQueue.QProcessor -- too many threads
> >
> > Aaron, I know we need to upgrade (we will, it's going through QA,
it's
> a
> > large application, problem is bad things are happening in production
> right
> > now :-).
> >
> > What triggers creation of a thread? (any call to getCache or
putCache
> with
> > a "new" - non-existent previously name)?
> >
> > Thanks,
> > Val
> >
> >
> >
> >
> > "Smuts, Aaron" <[EMAIL PROTECTED]>
> > 09/07/2005 01:38 PM
> > Please respond to "JCS Users List"
> >
> >         To:     "JCS Users List" <[email protected]>
> >         cc:
> >         Subject:        RE: ElementEventQueue.QProcessor -- too many
> > threads
> >
> >
> > The number is dependent on the number of regions.  The new JCS
allows
> > you to set thread pools to use and it has event queues that only
keep
> > threads alive for a limited period of time.
> >
> > You must be creating more regions as the day goes by.
> >
> > You need to upgrade!  1.0 is 2 years out of date.
> >
> > Aaron
> >
> > > -----Original Message-----
> > > From: [EMAIL PROTECTED]
> > [mailto:[EMAIL PROTECTED]
> > > Sent: Wednesday, September 07, 2005 1:38 PM
> > > To: [email protected]
> > > Subject: ElementEventQueue.QProcessor -- too many threads
> > >
> > > We are using JCS (an old version 1.0 upgrade to the latest is
> > scheduled
> > > but we are having problems in production and it's urgent :(. We
are
> > seeing
> > > lots of threads getting created as application is running (more
and
> > more
> > > getting created throughout the day). The threads are called
> > > ElementEventQueue.QProcessor- and then a number. I checked and all
> the
> > > puts into the cache are done for specific cache regions (there is
a
> > finite
> > > number of those: < 15, and the number of threads we see is 50+ and
> if
> > we
> > > let TomCat run for a while it keeps on growing)...
> > >
> > > Any help/suggesttions/pointers you can offer would be higly
> > appreciated...
> > >
> > >
> > > Thanks,
> > > Val
> >
> >
---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to