Mercurial > hg > blitz_stable
diff src/org/dancres/blitz/arc/ArcCache.java @ 23:b7e52953b7a6
Add some cache/memory statistics to help spot potential exhaustion and other tuning issues.
author | Dan Creswell <dan.creswell@gmail.com> |
---|---|
date | Fri, 28 Aug 2009 17:23:33 +0100 |
parents | 3dc0c5604566 |
children |
line wrap: on
line diff
--- a/src/org/dancres/blitz/arc/ArcCache.java Sat Aug 22 23:28:55 2009 +0100 +++ b/src/org/dancres/blitz/arc/ArcCache.java Fri Aug 28 17:23:33 2009 +0100 @@ -62,6 +62,16 @@ return theCacheSize; } + public int getActiveSize() { + int mySize; + + synchronized(this) { + mySize = theBlockIndex.size(); + } + + return mySize >> 1; + } + /** For recovery purposes, we wish to be able to ensure that something has made it to disk and, if it hasn't, re-insert it to the cache.