comparison src/org/dancres/blitz/arc/ArcCache.java @ 22: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
comparison
equal deleted inserted replaced
21:8417eaebf5ab 22:b7e52953b7a6
58 theListeners.add(aListener); 58 theListeners.add(aListener);
59 } 59 }
60 60
61 public int getSize() { 61 public int getSize() {
62 return theCacheSize; 62 return theCacheSize;
63 }
64
65 public int getActiveSize() {
66 int mySize;
67
68 synchronized(this) {
69 mySize = theBlockIndex.size();
70 }
71
72 return mySize >> 1;
63 } 73 }
64 74
65 /** 75 /**
66 For recovery purposes, we wish to be able to ensure that something 76 For recovery purposes, we wish to be able to ensure that something
67 has made it to disk and, if it hasn't, re-insert it to the cache. 77 has made it to disk and, if it hasn't, re-insert it to the cache.