Re: memory exhausted
- From: MenTaLguY <mental@xxxxxxxxx>
- Date: Wed, 11 Apr 2007 02:52:37 +0900
On Wed, 11 Apr 2007 02:28:33 +0900, "Luis Parravicini" <lparravi@xxxxxxxxx> wrote:
grepping the ruby source shows regex.c is the only file with that
string. And thats how far I got. Any ideas?
The error is coming from the parser. Here's a simpler test case using integers:
eval <<EOS
case x
#{ (0..2498).map { |n| "when #{n}: nil\n" }.join('') }
end
EOS
We know that it's happening at parse-time rather than run-time, because the out-of-memory error occurs before Ruby has a chance to complain that 'x' is undefined.
In short, the Ruby parser apparently cannot cope with case statements which have more than 2498 branches (at least with the build of Ruby I've got here, changing 2498 to 2497 is enough to avoid the memory issue).
-mental
.
- Follow-Ups:
- Re: memory exhausted
- From: Tim Pease
- Re: memory exhausted
- References:
- Re: memory exhausted
- From: Luis Parravicini
- Re: memory exhausted
- Prev by Date: [ANN] ClothRed (HTML to Textile)
- Next by Date: Re: [QUIZ] Getting to 100 (#119)
- Previous by thread: Re: memory exhausted
- Next by thread: Re: memory exhausted
- Index(es):
Relevant Pages
|
Loading