From dev-return-94088-apmail-cocoon-dev-archive=cocoon.apache.org@cocoon.apache.org Thu Apr 05 13:15:43 2007 Return-Path: Delivered-To: apmail-cocoon-dev-archive@www.apache.org Received: (qmail 81150 invoked from network); 5 Apr 2007 13:15:36 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 5 Apr 2007 13:15:36 -0000 Received: (qmail 1576 invoked by uid 500); 5 Apr 2007 13:15:42 -0000 Delivered-To: apmail-cocoon-dev-archive@cocoon.apache.org Received: (qmail 1499 invoked by uid 500); 5 Apr 2007 13:15:41 -0000 Mailing-List: contact dev-help@cocoon.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: dev@cocoon.apache.org List-Id: Delivered-To: mailing list dev@cocoon.apache.org Received: (qmail 1488 invoked by uid 99); 5 Apr 2007 13:15:41 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 05 Apr 2007 06:15:41 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: neutral (herse.apache.org: local policy) Received: from [213.133.33.40] (HELO smtp.is.nl) (213.133.33.40) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 05 Apr 2007 06:15:33 -0700 Received: from [213.133.51.241] (HELO hai01.hippo.local) by smtp.is.nl (CommuniGate Pro SMTP 5.0.10) with ESMTP id 13151027 for dev@cocoon.apache.org; Thu, 05 Apr 2007 15:15:23 +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: RE: StoreJanitor Date: Thu, 5 Apr 2007 15:15:11 +0200 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: StoreJanitor Thread-Index: Acd3gZX/Ohi43bHqQ066+nmG+LvFIAAAV+qQ From: "Ard Schrijvers" To: X-Virus-Checked: Checked by ClamAV on apache.org > IIUC, EHCache allows you to set only the number of items in=20 > cache, and not the=20 > maximum amount of memory to use, or minimum amount of free=20 > memory to leave. true (but the cache can't know the size of objects it gets stuffed with = (you say it is possible with java 1.5? ) ) >=20 > In other words, EHCache leaves you up for guessing what the=20 > number should be. It=20 > should not do this. Maximum number of items in memory should=20 > be whatever memory=20 > can bear, and cache should dump unused memory once free=20 > memory goes low. I do not agree. This would imply a JVM always reaching max memory while = this is not necessary.=20 Think you are talking about a SoftReferences cache based, but apart from = some drawbacks, the eviction policy is very hard to implement because you do not kwow = which reference the jvm throws away. IMO, the cache configuration, like maxelements (memory) and = maxdiskelements should be modifable during run time, but, this is not possible with ehcache or jcs. >=20 > Granted it can't be implemented cleanly in Java 1.4 (hence=20 > thread + interval=20 > hack) but on Java 1.5 it would work beautifully. All you need=20 > is a stinking API=20 > to clean out entries using LRU algorithm (or whatever is=20 > chosen). Or just switch=20 > to Cocoon's cache in the meantime. I haven't got problems with jcs if you know how large your stores can be = (crawler test and default sizes i have=20 configured for different jvm mem values). Throwing away all cache = experience of others and switch to cocoon cache does't seem to make sense to me >=20 >=20 > > JCS will probably do the same. I guess that original purpose of=20 > > StoreJanitor was when Cocoon had its own store implementations=20 > > (transient, persistent) and we had to take care of cleaning=20 > them up in=20 > > our code. >=20 > It still does, and at the moment is easier to live with than=20 > EHCache -- as shown=20 > by Ard in this email. Jcs does not give me any problems (except headache in configuration :-) = ) >=20 > Vadim >=20 >=20