cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefano Mazzocchi <stef...@apache.org>
Subject Re: (PATCH) Performance bug in Cocoon 1.7.3 MemoryStore :(
Date Mon, 15 May 2000 15:40:35 GMT
"Kevin A. Burton" wrote:
> 
> So this is bad :(

Oh, thanks for finding this one. I'm patching right away.
 
> There is a significant performance bug in the Cocoon MemoryStore in
> Cocoon 1.7.3.  
>The problem is that Thread.sleep excepts a value in
> milliseconds.  However the documentation and default is a value in
> seconds.  The call to Thread.sleep() wasn't using seconds... it was
> using milliseconds.  Thus the thread was in an infinite loop waiting for
> 100 milliseconds in between requests and was keeping CPU near 100%.
> 
> Here is a patch.
> 
> Index: src/org/apache/cocoon/store/MemoryStore.java
> ===================================================================
> RCS file:
> /home/cvspublic/xml-cocoon/src/org/apache/cocoon/store/MemoryStore.java,v
> retrieving revision 1.11
> diff -r1.11 MemoryStore.java
> 87c87
> <      * Indicates the time in millis to sleep between memory checks.
> ---
> >      * Indicates the time in seconds to sleep between memory checks.
> 125c125
> <     public void init(Configurations conf) throws
> InitializationException {
> ---
> >     public void init( Configurations conf ) throws InitializationException {
> 174,175c174,180
> <                 Thread.currentThread().sleep(this.interval);
> <             } catch (InterruptedException ignore) {}
> ---
> >                 Thread.currentThread().sleep( this.interval * 1000 );
> >             } catch (InterruptedException ignore) {
> >                 //granted that this exception should be ignored but if it does
> >                 //throw an exception this thread might get stuck in an infinite
> >                 //loop.
> >                 ignore.printStackTrace();
> >             }
> 203c208
> <         Object o = this.hashtable.get(key);
> ---
> >         Object o = this.hashtable.get( key );
> 320c325
> < }
> \ No newline at end of file
> ---
> > }
> --
> Kevin A Burton (burton@apache.org)
> http://relativity.yi.org
> Message to SUN:  "Please Open Source Java!"
> The house of the unbelievers shall be razed and they shall be
> scorched to the earth. Their code will be open until the end of days.


-- 
Stefano Mazzocchi      One must still have chaos in oneself to be
                          able to give birth to a dancing star.
<stefano@apache.org>                             Friedrich Nietzsche
--------------------------------------------------------------------
 Missed us in Orlando? Make it up with ApacheCON Europe in London!
------------------------- http://ApacheCon.Com ---------------------



Mime
View raw message