Return-Path: Delivered-To: apmail-jakarta-jcs-users-archive@www.apache.org Received: (qmail 98511 invoked from network); 19 Jul 2006 09:50:57 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 19 Jul 2006 09:50:57 -0000 Received: (qmail 50700 invoked by uid 500); 19 Jul 2006 09:50:57 -0000 Delivered-To: apmail-jakarta-jcs-users-archive@jakarta.apache.org Received: (qmail 50687 invoked by uid 500); 19 Jul 2006 09:50:57 -0000 Mailing-List: contact jcs-users-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "JCS Users List" Delivered-To: mailing list jcs-users@jakarta.apache.org Received: (qmail 50652 invoked by uid 99); 19 Jul 2006 09:50:57 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 19 Jul 2006 02:50:57 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: neutral (asf.osuosl.org: local policy) Received: from [213.133.33.30] (HELO mailrelay.is.nl) (213.133.33.30) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 19 Jul 2006 02:50:56 -0700 Received: from [213.133.51.241] (HELO hai01.hippo.local) by mailrelay.is.nl (CommuniGate Pro SMTP 4.3.5) with ESMTP id 20258085 for jcs-users@jakarta.apache.org; Wed, 19 Jul 2006 11:50:35 +0200 X-MimeOLE: Produced By Microsoft Exchange V6.0.6603.0 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Subject: question regarding removing a cachekey according the correct eviction policy from the outside Date: Wed, 19 Jul 2006 11:50:34 +0200 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: question regarding removing a cachekey according the correct eviction policy from the outside Thread-Index: AcarGMePSs3noxeCRdm3762g6J3Z0w== From: "Ard Schrijvers" To: X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Hello, I have a question regarding removing keys:=20 In cocoon we have a JCSDefaultStore implementing = org.apache.excalibur.store.Store interface. This interface has a method = free(). store.free() (store can be the EHDefaultStore (ehcache) or the = JCSDefaultStore, etc etc) is invoked by = org.apache.excalibur.store.impl.StoreJanitorImpl when the JVM is low on = memory.=20 Free() tries to remove cachekeys+response to free some memory. For = example, the JCSDefaultStore does it like below: public void free() { // TODO Find a better way MemoryCache memoryCache =3D = this.cacheManager.getCache(region).getMemoryCache(); Object[] keys =3D memoryCache.getKeyArray(); if ( keys !=3D null && keys.length > 0 ) { final Object key =3D keys[0]; try { memoryCache.remove((Serializable)key); } catch (Exception ignore) { =20 } } } The TODO speaks for itself. The EHDefaultStore using ehcache has this = very same problem. Just removing cachekeys starting at index 0 does not = improve the JVM when requests keep coming in, and the mainly important = keys have been removed.=20 I was told that from the outside, it is impossible to remove keys from = the ehcache according the correct eviction policy. Does this also hold = for JCS? And, furthermore, perhaps I just want to overflow the cached = responses to disk (without having reached maxobjects) instead of = removing them. That would clear memory and let me keep the cached = responses.=20 Is there something possible like,=20 public void remove(int numberKeys) and public void overflow(int numberKeys)=20 and that this is done according the correct eviction policy?=20 Regards Ard --=20 Hippo Oosteinde 11 1017WT Amsterdam The Netherlands Tel +31 (0)20 5224466 ------------------------------------------------------------- a.schrijvers@hippo.nl / http://www.hippo.nl --------------------------------------------------------------=20 --------------------------------------------------------------------- To unsubscribe, e-mail: jcs-users-unsubscribe@jakarta.apache.org For additional commands, e-mail: jcs-users-help@jakarta.apache.org