Thank you for the response.

I certainly understand how adding size as a restriction would be very 
performance limiting.  I was just hoping that I could fins a way to run in 
debug where I could get the size and then use this data to more accurately 
determine how many objects I should allow in the cache.

What kind of data does getStatistics() provide?  Does this not return size 
either?  I noticed this method in the LRUMemoryCache.  The version of JCS that 
I am currently using does not seem to have this method though.  

I tried to switch to JCS 1.2.6.  However, I am now getting the error:
java.lang.NullPointerException
        at java.io.Reader.<init>(Reader.java:61)
        at java.io.InputStreamReader.<init>(InputStreamReader.java:80)
        at java.util.Properties.load(Properties.java:266)
        at 
org.apache.jcs.engine.control.CompositeCacheManager.configure(CompositeCacheManager.java:170)
        at org.apache.jcs.JCS.ensureCacheManager(JCS.java:103)
        at org.apache.jcs.JCS.getInstance(JCS.java:63)
        at 
org.tiaa.j2eeinfra.cache.impl.TiaaJCSCacheFactory.accessCache(Unknown Source)
        at CacheTest.main(CacheTest.java:37)

Any idea what is causing that?

Thanks,
Ken


-----Original Message-----
From: Smuts, Aaron [mailto:[EMAIL PROTECTED]
Sent: Friday, September 23, 2005 2:52 PM
To: JCS Users List
Subject: RE: Cache Size


There is no method to get the size in bytes.  You can only approximate.
The admin bean used by the JCSAdmin.jsp writes the objects to a counting
output stream to get a rough idea of how much memory a region is using,
but there is no way to configure the cache to limit the size in bytes of
a region.

There is no way to accurately determine how much memory an object takes,
at least no way to get close that would not be too expensive to use.

We could put some limits on the cache using the memory size fuctions
available in the System class in jdk1.4, but this still wouldn't give
you the control you want.

Aaron


> -----Original Message-----
> From: Hoying, Ken [mailto:[EMAIL PROTECTED]
> Sent: Friday, September 23, 2005 1:53 PM
> To: jcs-users@jakarta.apache.org
> Subject: Cache Size
> 
> 
> I am trying to tune my cache settings.  In particular the number of
> objects that I want to allow in the cache.  I would like to determine
how
> large my cache is in bytes while debugging so that I can set the max
> number of elements in the cache appropriately.  The API seems to
indicate
> that I can get the size of an item in the cache with the getSize()
method.
> However, this is not working for me.  I always get 0.  What am I doing
> wrong?
> 
> BTW..  I am using the LRUMemoryCache.
> 
> Thanks in advance,
> Ken
> 
> 
> **************************************************************
> This message, including any attachments, contains confidential
information
> intended for a specific individual and purpose, and is protected by
law.
> If you are not the intended recipient, please contact sender
immediately
> by reply e-mail and destroy all copies.  You are hereby notified that
any
> disclosure, copying, or distribution of this message, or the taking of
any
> action based on it, is strictly prohibited.
> TIAA-CREF
> **************************************************************

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



**************************************************************
This message, including any attachments, contains confidential information 
intended for a specific individual and purpose, and is protected by law.  If 
you are not the intended recipient, please contact sender immediately by reply 
e-mail and destroy all copies.  You are hereby notified that any disclosure, 
copying, or distribution of this message, or the taking of any action based on 
it, is strictly prohibited.
TIAA-CREF
**************************************************************


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to