cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michel Lehon" <Michel.Le...@Outwares.com>
Subject RE: Memory Store and JDK 1.2
Date Tue, 29 Feb 2000 16:40:17 GMT
> From: Stefano Mazzocchi [mailto:stefano@apache.org]

>> From: Michel Lehon [mailto:michel.lehon@outwares.com]
>> It looks like JDK 1.2.2 under Win98 keeps all
>> SoftReferences alive unless it
>> really runs out of memory, at that time it clears all
>> SoftReferences in one
>> go (so the complete cache is cleared).
>
> Ouch, this is not that useful. I like the newer system in 1.7
> that calls
> the cache-cleanup if an OutOfMemory error is caught.
>
>> I know that the current JDK for Cocoon is 1.1 not 1.2.
>> However I though this might be useful for some user that
>> use JDK1.2 and
>> still experience OutOfMemoryExceptions.
>> The current implementation is very simple. It could be
>> improved by mixing it
>> with a classic cache algorithm.
>
> Hmmmm, the 1.7 MemoryStore is pretty complete on that side and yes, it
> should be far better for the JVM to implement that soft references on
> its own... but if the behavior is that bad, I prefer to use what we
> have.
>

To be honest I prefer the 1.7 way to handle things right now (looping until
it gets enough memory freed by the store).
But it has one big draw back... It only works if the OutOfMemoryException is
thrown by Cocoon.
What happens if another Servlet needs more memory and fails to get it ? I
don't really know but I guess the JVM
tries to recall what it can... if it still fails it will just quit with the
error message. The JVM will never call the cocoon cache's flush method.
This was one of the aims of this test implementation using SoftReferences,
they would be cleared by the JVM
regardless of the location of the OutOfMemoryException.

However I'm disapointed too that the JVM is not more clever when it clears
these references.

I'll do more testing to get a clearer picture of what is happening.
I hope to find a way to avoid the whole cache to be cleared... gone
hunting...

>Thank you anyway for the suggestion, I'll keep it in mind for the next
>releases in case the OutOfMemory error is not solved.

Well that was the aim... get a few of the remaining brain cells away...
(when Cocoon 2 goes prod. You'll get your beer to get rid of the last ones).

Michel Lehon.
Michel.Lehon@Outwares.com
SAS Data Warehousing & Web enablement.


Mime
View raw message