jakarta-jcs-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Smuts, Aaron" <Aaron.Sm...@travelocity.com>
Subject RE: Cache Size
Date Fri, 23 Sep 2005 18:52:14 GMT
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.


> -----Original Message-----
> From: Hoying, Ken [mailto:KHoying@tiaa-cref.org]
> 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
> 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
> that I can get the size of an item in the cache with the getSize()
> 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
> intended for a specific individual and purpose, and is protected by
> If you are not the intended recipient, please contact sender
> by reply e-mail and destroy all copies.  You are hereby notified that
> disclosure, copying, or distribution of this message, or the taking of
> action based on it, is strictly prohibited.
> **************************************************************

To unsubscribe, e-mail: jcs-users-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jcs-users-help@jakarta.apache.org

View raw message