Lines Matching defs:size
42 * . maximum size. Replacements are made in LRU order.
51 * possible to simple set the maximum size to a very large value and let
52 * the GC automatically size the cache dynamically depending on the
57 * eagerly. Performance may be improved if the Java heap size is set to larger
63 * maximum cache size to value that uses those buckets fully. For example,
65 * maximum size of 750 would be a good choice: try 1024 buckets, with a
68 * generally reasonable to set the size to a fairly large value.
81 public abstract int size();
104 * Set the maximum size.
106 public abstract void setCapacity(int size);
119 * Return a new memory cache with the specified maximum size, unlimited
122 public static Cache newSoftMemoryCache(int size) {
123 return new MemoryCache(true, size);
127 * Return a new memory cache with the specified maximum size, the
131 public static Cache newSoftMemoryCache(int size, int timeout) {
132 return new MemoryCache(true, size, timeout);
136 * Return a new memory cache with the specified maximum size, unlimited
139 public static Cache newHardMemoryCache(int size) {
140 return new MemoryCache(false, size);
151 * Return a new memory cache with the specified maximum size, the
155 public static Cache newHardMemoryCache(int size, int timeout) {
156 return new MemoryCache(false, size, timeout);
210 public int size() {
230 public void setCapacity(int size) {
280 int startSize = cacheMap.size();
299 int endSize = cacheMap.size();
328 + " expired entries, remaining " + cacheMap.size());
333 public synchronized int size() {
335 return cacheMap.size();
362 if (maxSize > 0 && cacheMap.size() > maxSize) {
364 if (cacheMap.size() > maxSize) { // still too large?
402 public synchronized void setCapacity(int size) {
404 if (size > 0 && cacheMap.size() > size) {
406 for (int i = cacheMap.size() - size; i > 0; i--) {
417 maxSize = size > 0 ? size : 0;
420 System.out.println("** capacity reset to " + size);
442 Map<Object,Object> kvmap = new HashMap<Object,Object>(cacheMap.size());