cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Niclas Hedhman <nic...@localbar.com>
Subject Re: Memory Store and JDK 1.2
Date Wed, 01 Mar 2000 02:03:11 GMT
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
grievance.

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.

Niclas


Mime
View raw message