Hi,
I've recently heard about the locals clearing feature of Clojure 1.2 (from a
recent post by Ken Wesson), and decided to test-drive it. Here is a
contrived example:
(defn garbage []
(make-array Byte/TYPE 10485760))
(defn -main [& args]
(let [a (garbage)
b (garbage)
c (garbage)
d (garbage)
e (garbage)
f (garbage)
g (garbage)
h (garbage)]
(println "OK")))
Now, when I build this with Leiningen and try to run under -Xmx20M or so, it
bombs out on me with an OOME. Changing the let to a bunch of nested lets
doesn't help, nor does migrating to Clojure 1.3alpha4.
Shouldn't the locals clearing feature detect that each of the a-h locals is
no longer needed and clear them right after allocation? Is this a
misconception on my part about how this works? Or is something weird going
on here?
Thanks,
-Daniel
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to [email protected]
Note that posts from new members are moderated - please be patient with your
first post.
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en