ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Maarten Coene (JIRA)" <>
Subject [jira] Resolved: (IVY-791) Memory leak in
Date Fri, 04 Apr 2008 20:57:24 GMT


Maarten Coene resolved IVY-791.

       Resolution: Fixed
    Fix Version/s: 2.0-RC1
         Assignee: Maarten Coene

Updated the code as you suggested.
Thanks for reporting this.

> Memory leak in
> ------------------------------------
>                 Key: IVY-791
>                 URL:
>             Project: Ivy
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 2.0.0-beta-2
>            Reporter: Archie Cobbs
>            Assignee: Maarten Coene
>             Fix For: 2.0-RC1
> In an attempt is made to create a "canconical instance" cache like
{{String.intern()}} using this static field:
> {noformat}
> private static final Map/*<ModuleRevisionId, ModuleRevisionId>*/ CACHE = new WeakHashMap();
> {noformat}
> This doesn't work: each entry is both a key and a value, so the strong reference to the
key will never allow the weak reference to the value to be the only remaining reference, and
so entries will never be dropped.
> You have to wrap the keys in a WeakReference.
> See [Classpath's implementation of String.intern()|]
for an example.

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

View raw message