hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Roland Weber (JIRA)" <j...@apache.org>
Subject [jira] Commented: (HTTPCORE-79) DateUtils should cache SimpleDateFormat
Date Sun, 10 Jun 2007 17:14:26 GMT

    [ https://issues.apache.org/jira/browse/HTTPCORE-79?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12503188

Roland Weber commented on HTTPCORE-79:

If there are many threads making few calls each to this method, we are opening a memory hole.
In particular since a whole map of formats is stored. Can we please wrap the map in a SoftReference
to allow garbage collection?

There is an @Override in the source code, and not inside a comment. I don't know what it's
supposed to mean, but it is not valid Java 1.3 source.


> DateUtils should cache SimpleDateFormat
> ---------------------------------------
>                 Key: HTTPCORE-79
>                 URL: https://issues.apache.org/jira/browse/HTTPCORE-79
>             Project: HttpComponents Core
>          Issue Type: Improvement
>          Components: HttpCore
>    Affects Versions: 4.0-alpha5
>            Reporter: Daniel Müller
>            Priority: Minor
>         Attachments: org.apache.http.util.patch
> DateUtils create a SimpleDateFormat for each invocation of #formatDate and #parseDate.
This can be optimized if SimpleDateFormat instances are cached. Since SimpleDateFormat is
not threadsafe, the cache must be threadlocal.

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

To unsubscribe, e-mail: httpcomponents-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: httpcomponents-dev-help@jakarta.apache.org

View raw message