This is the mail archive of the
kawa@sources.redhat.com
mailing list for the Kawa project.
Re: Another java.lang.StackOverflowError
On Mon, May 17, 2004 at 12:42:11PM -0700, Chris Dean wrote:
>
> 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?
>
The OutOfMemoryError is not my concern. My problem lies in the
foldl-seq implementation, which results in StackOverflowError
very early. That indicates something like
(let loop (....)
...
(loop .....))
does not always work as a Lisp (GO somewhere) replacement.
Thanx!
Wen-Chun Ni