|
From: Claudio D'A. <cla...@ob...> - 2004-07-15 09:26:14
|
Hi,
I'm analyzing with OptimizeIt my web application:
when I redeploy the application I note that instances of
CachedIntrospectionResults still in memory and for any redeploy the
instances raise.
I think that the problem is caused by ClassLoader that don't flush the
static variables.
To remove the problem I've modify the code of
CachedIntrospectionResults.forClass method:
if (results == null) {
// can throw BeansException
results = new CachedIntrospectionResults(clazz);
boolean cacheSafe = isCacheSafe(clazz);
if (logger.isDebugEnabled()) {
logger.debug("Class [" + clazz.getName() +
"] is " + (!cacheSafe ? "not " : "") + "cache-safe");
}
classCache.put(clazz, new WeakReference(results));
}
With the WeakReference the instances are flushed when I redeploy the
application.
Are there problems with this modification (in production/test environment)?
Grazie e buon lavoro
----------
Claudio D'Angelo
Software Consultant
ObjectWay S.p.A.
Via G.A. Boltraffio 7
20159 Milano (MI)
http://www.objectway.it
--
La presente comunicazione potrebbe contenere informazioni riservate e/o
protette
da segreto professionale ed e' indirizzata esclusivamente ai destinatari della
medesima qui indicati. Se avete ricevuto per errore la presente comunicazione,
siete invitati a segnalarcelo, rispondendo a questo stesso indirizzo di
e-mail,
e a cancellare il presente messaggio dal Vostro sistema. E' strettamente
proibito
e potrebbe essere fonte di violazione di legge qualsiasi uso, comunicazione,
copia
o diffusione dei contenuti di questa comunicazione da parte di chi la abbia
ricevuta per errore o in violazione degli scopi della presente.
Il messaggio e' stato analizzato alla ricerca di virus o contenuti pericolosi
ed
e' risultato NON infetto.
|