On Sun, May 4, 2008 at 3:05 AM, Matthew Toseland <toad at amphibian.dyndns.org> wrote: > On Friday 02 May 2008 11:09, j16sdiz at freenetproject.org wrote: > > Author: j16sdiz > > Date: 2008-05-02 10:09:13 +0000 (Fri, 02 May 2008) > > New Revision: 19674 > > > > Modified: > > trunk/freenet/src/freenet/crypt/SHA256.java > > Log: > > limit number of cached SHA256 md > > Any particular reason for a limit of 16? We use a lot of SHA256's... >
0) This is part of my "use lessor memory" patches 1) 16 is the number of SHA-256 keep in the pool. Instances in use are not counted here.. 2) We use lots of SHA256, but we don't use them at the same time. (obviously we can't do more SHA256 then number of CPU) 3) Most SHA256 instance return to pool very quickly, no thread should keep a SHA256 instance for a long time. 4) (follow #2, #3) keeping more then # of CPU copies sounds redundant to me 5) It never use more then 12 instance on my box.