geronimo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jeremy Boynes" <>
Subject RE: Logging code and Garbage Collection
Date Wed, 13 Aug 2003 15:26:03 GMT
> From: Jason Dillon [] 
> I would depend on how it was cached.  If you mean if a method 
> traces or 
> debugs more than once, it should definitely create a local 
> variable to 
> cache if the level is enabled, but if you mean for a larger scoped 
> cache, this could make it hard to debug a running server, as you can 
> always tweak the active levels at runtime.
Local variable, a given.

The thing is, the isXEnabled() method gets called a gazillion times to
detect the one time that the level was bumped up, which happends very
infrequently. I'm assuming this goes through a synchronized block as
well, add yet more ns to the call. The runtime feature is useful but has
a price.

Some form of lazy caching scheme may be appropriate, provided checking
invalidation is quicker than the call to isXEnabled().


View raw message