>Hi there,
>I've been following this thread with quite some interest.
>
>I like the idea of one monitoring thread that checks memory
>and then calls on the different stores to free some up if
>necessary.
>
>As an attachment I included a (very rough, first version, pre-alpha...
>you get it;-) StoreJanitor.
>
>To get this to run in your environment do the following:
>1) add a new role named "janitor" to org/apache/cocoon/cocoon.roles
>2) add an <janitor> element to cocoon.xconf,
> similar to the MRUMemoryStore ones
>3) Expand the Store interface by a "public void free()" method.
>4) Add the Store to the Janitor surveillance, i.e.:
> StoreJanitor janitor = (StoreJanitor)manager.lookup(StoreJanitor.ROLE);
> janitor.addToSurveillance(this);
>
>As mentioned above, this is far from complete. I'm sending this in
>so people that are more knowledgable than I am can take a look at
>it.
>
>I'd appreciate any (rocks!, sucks) feedback.
Cool idea, but some things are missing I think:
- Now the the StoreJanitor is the master of memory. So he must do the
finalization and forcing the gc(). I added a freeMemory() method in
your code and logic.
- you have to loop till memory is normal. I changed the while loop
a little bit and added some comments. What happens, when the loop comes
to the end of your list of stores and memory is still low?
Sorry I just overlooked it in few minutes (less time today). Tomorrow I
will take a closer look.
I added my changes to this postings. But this is just a prototype!
Cheers
Gerhard
StoreJanitor.java
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]