jakarta-jcs-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Niall Gallagher <ni...@switchfire.com>
Subject Re: JCS disk spooling when memory is low
Date Thu, 10 Jul 2008 12:51:42 GMT
Hi Andy,

I don't think JCS will monitor the amount of physical memory and spool
objects when it is low. Very few if any Java-based caches do that as far
as I know.

I guess such a thing could be implemented as a plugin/auxiliary to JCS
(based on SoftReference or the MemoryMXBean or something).

You can find out exactly how much RAM objects in your JVM are taking up
using the jmap command. For example "jmap -histo:live $APP_PID | head
-n33" outputs the top 30 memory-consuming objects in the JVM. Divide the
memory consumed for each object type by the number of instances and
that's the amount of RAM each object of that type occupies. You could
then tune the MaxObjects setting in your ccf to control memory usage.

In practical terms however I think spooling objects to disk when memory
is low would have lots of performance-related questions to answer.

For example if the purpose of caching is to improve the performance of
the app, then allowing a low memory situations to occur negates the
purpose of caching. Especially because low memory situations would occur
at times of peak traffic, the times at which caching would be most
valuable. If the purpose of caching is to reduce load on databases, then
likewise reducing the effectiveness of caching at peak times would
defeat the purpose.

Kindregards,

Niall

On Wed, 2008-07-09 at 12:35 -0600, Zhang, Andy wrote: 

> Hi,
> 
>  
> 
> I am trying to figure out if JCS will spool the objects in memory to
> disk when the JVM available memory is low?  Is this automatic or do I
> need to set some parameters?
> 
>  
> 
> Any help or advice will be greatly appreciated.
> 
>  
> 
> Thanks,
> 
>  
> 
> Andy
> 
>  
> 
> 
> ------------------------------------------------------------------------------
> This e-mail transmission may contain information that is proprietary, privileged and/or
confidential and is intended exclusively for the person(s) to whom it is addressed. Any use,
copying, retention or disclosure by any person other than the intended recipient or the intended
recipient's designees is strictly prohibited. If you are not the intended recipient or their
designee, please notify the sender immediately by return e-mail and delete all copies. OppenheimerFunds
may, at its sole discretion, monitor, review, retain and/or disclose the content of all email
communications. 
> ==============================================================================





Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message