Gordon Yorke-2 wrote:
>
> This is interesting... What you are seeing in the second call
> (getSize(Class, boolean)) is that the 'dead' cachekeys are not being
> reported because they have no object and the class comparison fails.
> With the first call (getSize()) there is no class check so all of the
> cachekeys are being counted even the 'dead' (garbage collected
> references).
> This code is considered internal and it seems that I sent you down the
> incorrect path by mentioning the first method. The second method is the
> only way to verify the actually number of objects in the cache. The
> first method (getSize()) returns the number of references currently in
> the cache (both active and gc'd). Both values will fluctuate in an
> active cache as the gc'd references are released from the cache but they
> give very different results.
> --Gordon
>
Thanks a lot. This makes perfect sense.
Cheers,
--
View this message in context: http://www.nabble.com/Some-questions-about-HardWeak-SoftWeak-cache-tp17354187p17397032.html
Sent from the java.net - glassfish persistence mailing list archive at Nabble.com.