This is the mail archive of the
kawa@sources.redhat.com
mailing list for the Kawa project.
Another java.lang.StackOverflowError
- From: Chris Dean <ctdean at sokitomi dot com>
- To: Wen-Chun Ni <wcn at tbcommerce dot com>
- Cc: Kawa List <kawa at sources dot redhat dot com>
- Date: Mon, 17 May 2004 12:42:11 -0700
- Subject: Another java.lang.StackOverflowError
- References: <20040517193545.GA17265@tbcommerce.com>
> Suppose we use a trivial function (mk-list n) to produce a list
> of length n, then the first one works in
>
> (foldl + 0 (mk-list n))
>
> for n less than or equal to 2000000. Beyond that, it gives OutOfMemoryError.
That's because your JVM is running out of memory for a list that big.
Just add more memory the the Java process:
java -Xms300m -Xmx300m kawa.repl
#|kawa:1|# (require 'list-lib)
#|kawa:2|# (length (make-list 3000000 1))
3000000
Your tail recursive foldl works fine for me:
#|kawa:14|# (foldl + 0 (make-list 3000000 1))
3000000
Was there another issue I'm missing?
Regards,
Chris Dean