I wouldn't call this a memory leak: vectors have a bigger memory overhead
than before (additional PersistentVector$Node and AtomicReference).

On Sat, Aug 15, 2009 at 2:13 AM, Andy Fingerhut <
andy_finger...@alum.wustl.edu> wrote:

> When I did this, one of the first several lines of output included a
> little more than 1 AtomicReference object per calls to vec.
>
>  num     #instances         #bytes  class name
> ----------------------------------------------
>   6:        500022       12000528
> java.util.concurrent.atomic.AtomicReference
>
> Would it be correct to nullify the reference to the persistent object
> returned by a call to persistent! on a transient object?


For a single persistent object (built with transients) there are potentially
several references to the same AtomicReference. I think that you can't
nullify all references and have persistent! still be O(1).

One AtomicRefrence is created for each pair of transient/persistent! calls
and, in worst case, you can't have more than one AtomicReference per
PersistentVector$Node. So, for a given vector it won't grow indefinitely.

OTH,

Christophe

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to