cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefano Mazzocchi <>
Subject Re: Memory Store and JDK 1.2
Date Wed, 01 Mar 2000 02:37:59 GMT
Niclas Hedhman wrote:
> Stefano Mazzocchi wrote:
> > 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.
> There is one problem with this strategy though.
> OutOfMemoryError is not an Exception, and for good reasons. It may occur, theoretically
at any instruction
> of the JVM, not necessarily at well-defined spots. There are many instances where there
is no way to
> recover after such an ERROR has occurred, and the application should fail to avoid further

You're totally right. In fact, the MemoryStore is not based on catching
OutOfMemory but this is a last resource to avoid this error to come all
the way up to the user. In fact, doesn't the 1.7 system work better than
1.6? I think so. It may not be perfect, but it's a good step forward.
> The SoftReferences are not particularly good either, since they are all reclaimed in
a single go, since
> the GC has no clue of which would be the best to keep.
> BUT, as far as I know, there are ways to hook into the JVM's GC and/or heap manager to
be notified of
> GC events and low memory conditions. I don't know at this time if it is documented, but
the RMI subsystem
> uses it even in JDK 1.1.

If we really want to get that close to the JVM (and loose much of our
portability), then we would be able to do magic stuff with the debug and
profiling interfaces of Java 1.2....

but do we really want to dive that deep?

Stefano Mazzocchi      One must still have chaos in oneself to be
                          able to give birth to a dancing star.
<>                             Friedrich Nietzsche
 Come to the first official Apache Software Foundation Conference!  
------------------------- http://ApacheCon.Com ---------------------

View raw message