Hi,
Am 06.10.2009 um 00:55 schrieb Mark Tomko:
To be explicit, the doall needs to be before the call to recur (that
is, it affects the map). Is that right?
Yes. It must look like (recur (doall (map ...))).
Sincerely
Meikel
smime.p7s
Description: S/MIME cryptographic signature
To be explicit, the doall needs to be before the call to recur (that
is, it affects the map). Is that right?
On Oct 5, 1:31 am, Meikel Brandmeyer wrote:
> Hi,
>
> On Oct 5, 9:50 am, Volkan YAZICI wrote:
>
> > > (defn leak []
> > > (loop [v [0 0]]
> > > (recur (map + v [1 1]
>
> > >
> You're right, it was a memory leak, although it took me hours to find.
> Clojure's lazy lists were responsible for the leak; I wasn't honestly
> expecting this innocent looking code to be so insidious
$0.02 another instance of this that makes me think laziness needs to
be explicit in the sy
Hi,
On Oct 5, 9:50 am, Volkan YAZICI wrote:
> > (defn leak []
> > (loop [v [0 0]]
> > (recur (map + v [1 1]
>
> > Adding a doall call fixed the leak.
>
> Could you please provide a more concrete (if possible working) example?
> I'm trying to figure out the actual reason of the problem
On Sun, 4 Oct 2009, Elliott Slaughter writes:
> You're right, it was a memory leak, although it took me hours to find.
> Clojure's lazy lists were responsible for the leak; I wasn't honestly
> expecting this innocent looking code to be so insidious
>
> (defn leak []
> (loop [v [0 0]]
>
On Oct 4, 4:01 am, Christophe Grand wrote:
> Are you sure you aren't leaking memory? (by keeping a reference to an ever
> growing state -- do you use memoize?)
You're right, it was a memory leak, although it took me hours to find.
Clojure's lazy lists were responsible for the leak; I wasn't hone
Hi,
Are you sure you aren't leaking memory? (by keeping a reference to an ever
growing state -- do you use memoize?)
Christophe
On Sat, Oct 3, 2009 at 10:22 PM, Elliott Slaughter <
elliottslaugh...@gmail.com> wrote:
>
> Thanks.
>
> JVisualVM shows the initial memory usage is a couple hundred MB
Thanks.
JVisualVM shows the initial memory usage is a couple hundred MB, then
decreases to levels about what you described. I'm using a 64-bit Java
with the -server option to increase the max heap size.
But in my actual application, the memory performance is much worse:
the heap size keeps growi
Hi,
to measure memory requirements of java programs, it is better use a
tool like jvisualvm. The JVM process aquires memory as it needs
according to its max heap and max permgen settings.
I ran your little snippet on my machine with java -Xmx5M -jar
clojure.jar, and
while jvisualvm reported arou