cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gerhard Froehlich" <g-froehl...@gmx.de>
Subject RE: Store Janitor Hangs System
Date Sun, 27 Jan 2002 17:51:36 GMT
Hi,
Damn, I hoped you didn't find it ;-).

Yes I called first the free() method and then
I increased the index. I fixed that in the last
cvs commit!

Check it out and test it!

Thx for your feedbacks!!

  Gerhard
 
"Some people say I am a terrible person, I'm not, 
I have the heart of a young boy, in a jar, on my desk. 
(Stephen King)"

>-----Original Message-----
>From: Peter Hargreaves [mailto:pdh@totalise.co.uk]
>Sent: Saturday, January 26, 2002 5:51 PM
>To: cocoon-dev@xml.apache.org
>Subject: RE: Store Janitor Hangs System
>
>
>Hi Gerhard,
>
>I'm posting this separately under the same heading because it's probably 
>less relevant.
>
>While analysing the store-janitor code I found some strange things in 
>the way Store-janitorImpl.freeMemory() increments the store index.
>
>I assume that each successive call to freeMemory() is intended to free 
>an item from the next store, starting again when the last store is 
>reached. If there are 3 stores then the sequence for index should be: 
>0,1,2,0,1,2,0,1,2,0,1,2,... Is this correct? (three different indexes)
>
>When there are 3 stores my debug log reports the following sequence:
>
>Index before:  -1,0,1,2,3,0,1,2,3,0,1,2,3,0,1,2,....(four different 
>indexes repeat)
>Freeing at:    -1,0,1,2,*,0,1,2,*,0,1,2,*,0,1,2,....
>(corrected):    0,0,1,2,0,0,1,2,0,0,1,2,0,0,1,2,....(store 0 is more 
>frequent)
>Index after:    0,1,2,3,0,1,2,3,0,1,2,3,0,1,2,3,....
>
>'*' is where debug message says "Starting from the beginning" and from 
>the code you can see that it actually does a freeing at 0.
>
>                 if (this.getLogger().isDebugEnabled() == true) {
>                     this.getLogger().debug("Starting from the beginning");
>                 }
>                 this.resetIndex();
>                 ((Store)this.getStoreList().get(0)).free();
>                 this.setIndex(0);
>
>(corrected) is what actually gets freed, taking into account the above 
>and the following false debug message on the first attempt.
>
>                 if(this.getIndex() == -1) {
>                     if (this.getLogger().isDebugEnabled() == true) {
>                         this.getLogger().debug("Freeing at index=" + 
>this.getIndex());
>                     }
>                     ((Store)this.getStoreList().get(0)).free();
>                     this.setIndex(0);
>                 } else {
>
>It says it is "Freeing at index=-1" but then actually frees at index 0.
>
>Conclusion 1: Debug printout is a bit misleading.
>Conclusion 2: Items are removed from store 0 twice as often as from 
>stores 1 and 2.
>
>Have I got this right? Is it intentional or a mistake?
>
>Regards,
>Peter.
>
>P.S. The debug printout is on my initial posting under this heading.
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
>For additional commands, email: cocoon-dev-help@xml.apache.org
>
>


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


Mime
View raw message