[EMAIL PROTECTED]
The DateFormat[] passed in from Request.parseDate() is *identical* to
the static "formats" in FHDF, so why are we not just passing "null"
from Request.parseDate() and leverage FHDF.formats (instead of having
each Request object provide its own SimpleDateFormat[] instance var)?

Is it to avoid that the potentially expensive date parsing is
performed inside the synchronized block?


Yes, it's sort of obvious ;)
How much memory does a formatter uses ? I'd like to point out that pasing of dates will happen relatively often (last modified headers in requests, etc).


To summarize:
- passing null is correct, but syncs (otherwise it wouldn't work)
- passing a thread local formatter is correct
- passing a shared formatter isn't correct (as there would be thread safety issues)

Agreed.

I stumbled across mem usage as I was running a stress test
under OptimizeIt (and eventually getting OutOfMemory errors from
Servlets), and noticed a large number of char[] instances had been
allocated due to each Request creating its own SimpleDateFormat[].


Jan


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to