cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gerhard Froehlich" <g-froehl...@gmx.de>
Subject [c2] MRUMemoryStore: can this really work?
Date Fri, 24 Aug 2001 22:29:08 GMT
Hi,
Because of Vadims entitled objections I just overlooked the cleanupthread
in the MRUMemoryStore.
When I developed this store I overtaken this thread from the MemoryStore
of cocoon1 with the believe that it works.

But thinking a little bit about it, I have my doubts that the while
loop below works.
The free() method removes the last element of the cache. But it's
guaranteed that memory is immediately deallocated? The gc()is thread
with minor priority and I have the apprehension that due this case
this algorithm doesn't work right.

What do you think out there?
<snip>
if (this.jvm.totalMemory() - this.jvm.freeMemory() > this.heapsize) {
  this.jvm.runFinalization();
  this.jvm.gc();
  synchronized (this) {
    while ((this.cache.size() > 0) && (this.jvm.freeMemory() <
this.freememory)) {
      this.free();
     }
  }
}
</snip>

Greets
Gerhard


---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Mime
View raw message