- About Scala
- Documentation
- Code Examples
- Software
- Scala Developers
scalac stackoverflow - max number of terms ?
Mon, 2008-12-22, 11:20
hi
what is the maximum number of terms for an expression ?
I am using scala 2.7.2.final
i got a stack overflow when adding 79 Ints: (78 is okay ;-)
object Stress {
1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1
}
Merry Christmas
meiko
Mon, 2008-12-22, 11:47
#2
Re: scalac stackoverflow - max number of terms ?
Ah, yes - of course...
How to do it in the eclipse plugin ?
Ricky Clarkson schrieb:
> You can probably 'fix' this by increasing the amount of stack space
> you give scalac.
>
> In general, I think scalac should either use the trampolining
> technique discussed a month ago (stolen from Clojure) for many such
> cases, or default to a larger stack.
>
> 2008/12/22 meiko rachimow >
>
> hi
>
> what is the maximum number of terms for an expression ?
>
> I am using scala 2.7.2.final
> i got a stack overflow when adding 79 Ints: (78 is okay ;-)
>
> object Stress {
> 1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1
> }
>
> Merry Christmas
>
> meiko
>
>
Tue, 2008-12-23, 15:17
#3
Re: scalac stackoverflow - max number of terms ?
eclipse.exe -vmargs -Xss2M
gives you 2M stack per thread. You might need to increase the heap memory as well (using -Xmx)
You have to run Eclipse under Java 6 under Windows as the 1.5 has a bug that renders the -Xss usesless
Trampolining the compiler might be the right idea. I got a stack overflow that correlates to the size of a mixed project. It is very annoying to have your whole project's development break down because you add a class to your project - especially when the standard parameters for Eclipse work fine for the whole project until your rewrite four classes in Scala.
/Carsten
On Mon, Dec 22, 2008 at 11:38 AM, meiko rachimow <meiko@tfh-berlin.de> wrote:
gives you 2M stack per thread. You might need to increase the heap memory as well (using -Xmx)
You have to run Eclipse under Java 6 under Windows as the 1.5 has a bug that renders the -Xss usesless
Trampolining the compiler might be the right idea. I got a stack overflow that correlates to the size of a mixed project. It is very annoying to have your whole project's development break down because you add a class to your project - especially when the standard parameters for Eclipse work fine for the whole project until your rewrite four classes in Scala.
/Carsten
On Mon, Dec 22, 2008 at 11:38 AM, meiko rachimow <meiko@tfh-berlin.de> wrote:
Ah, yes - of course...
How to do it in the eclipse plugin ?
Ricky Clarkson schrieb:
You can probably 'fix' this by increasing the amount of stack space you give scalac.
In general, I think scalac should either use the trampolining technique discussed a month ago (stolen from Clojure) for many such cases, or default to a larger stack.
2008/12/22 meiko rachimow <meiko@tfh-berlin.de <mailto:meiko@tfh-berlin.de>>
hi
what is the maximum number of terms for an expression ?
I am using scala 2.7.2.final
i got a stack overflow when adding 79 Ints: (78 is okay ;-)
object Stress {
1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1
}
Merry Christmas
meiko
In general, I think scalac should either use the trampolining technique discussed a month ago (stolen from Clojure) for many such cases, or default to a larger stack.
2008/12/22 meiko rachimow <meiko@tfh-berlin.de>