From: <Web...@St...> - 2004-07-22 09:33:23
|
On Wed, 21 Jul 2004, Sebastian Kanthak wrote: | On Tuesday 20 July 2004 10:40, Endre St=F8lsvik wrote: | > If the templates were put into the cache using "soft references" .. | | they are, see WebMacro.defaults: | | # Advanced properties: | ReloadingCacheManager.*.UseSoftReferences: TRUE Eh.. okay..! 99% of my email's point vanished by that..! But, why are a thread being used for expiration at all? One could add the template with a timestamp, and then compare this timestamp with "now", an= d decide whether to use it or not based on this comparison. The softness of the referencing would ensure that memory were never depleted. The only reason for firing up a thread would be in development or possibl= y debugging, as to get some idea of what the "working set" of templates was at any given point - but this is more of a special optional feature.. | | > | BTW, the thread is started by a class in the concurrent package, an= other | > | _library_... ;) | > | > Well, another bad library! ;) | > | > Really, I don't like libraries that fire up Threads w/o me asking in | > particular for it. A program with millions of Threads, where each hav= e one | > specific stupid little chore. | [snip] | > And, btw, I do know that the concurrent package is very nice, but fir= ing | > up Threads here and there and everywhere is really bad in my opinion, | > anywhichway - one immediately get such problems as we now face. | | to be fair to that library: If you instantiate a ClockDaemon object and | provide it with a ThreadFactory, you more or less expect it to start th= reads, | don't you? ;) Of course! As I said, the concurrent package is very nice and all, but still, Threads are (often) evil! And thus it is webmacro that gets the blame: it uses threads, by default, w/o any real need for it. This can cause problems. | | > | However, one could add logic to only start this thread, if the | > | functionality to remove templates from the cache after some time is | > | actually used (e.g. ExpireTime is set to a positive value). | > | > YES! YES! YES!!! | > | > Ehh.. I'd love to see this functionality implemented.. ;) | > (As a first step) | | I just checked this today and found, that this is actually is the behav= iour of | 2.0b1. Just put this line into your WebMacro.properties and WebMacro wo= n't | fire up any threads, as far as I can see. | | ReloadingCacheManager.*.ExpireTime: -1 Okay - what about my suggestion above: let this be the default, but don't -use- templates that are older than "ReloadWhenOlderThan"? One question, not much related: Are specific settings higher in priority than more general? (from WebMacro.defaults :) --------- # Larger bucket size for the PropertyOperator cache seems to speed test r= uns StaticSMapCacheManager.PropertyOperator.CacheBuckets: 10001 [.. chop ..] StaticSMapCacheManager.*.CacheBuckets: 1001 --------- Thanks for nice answers, Endre |