[racket] Racket Virtual Machine runs out of memory

From: Matthias Felleisen (matthias at ccs.neu.edu)
Date: Fri Jul 20 09:51:30 EDT 2012

On Jul 20, 2012, at 9:38 AM, Harry Spier wrote:

> Dear list members,
> As part of my application I create a list of lists of 1's and 0's
> from an image file.
> When the size of the list of lists is: 1055 x 1066 it works fine,
> but when the size of the list of lists is: 4091 x 5023 then the
> program aborts with the error message:
> Racket Virtual Machine run out of memory: Aborting
> I've narrowed the error down to where I create the l create the list.
> I.e. the error occurs during creation of the list and not during use
> of the list.
> I compiled the program with no debugging information using the
> DrRacket "create executable" option and then ran the executable.
> Any suggestions of what I can do to get around this?
> Thanks,
> Harry Spier
> ____________________
>  Racket Users list:
>  http://lists.racket-lang.org/users

I just ran the below inside of DrRacket on a 2-year old MacMini: 

Welcome to DrRacket, version [3m].
Language: racket.
> (define l (time (build-list (* 4091 5023) (λ (x) 1))))
cpu time: 19862 real time: 163710 gc time: 12883
> (length l)
> (* 4091 5023)

So creating this list takes a while in DrRacket with the standard configuration but traversing it is lighting fast, as you'd expect. Is it possible that you have set a memory limit or that you are creating other large data structures that consume space? The list is large but not that large. 

-- Matthias

Posted on the users mailing list.