[racket] Racket Virtual Machine runs out of memory

From: Harry Spier (vasishtha.spier at gmail.com)
Date: Fri Jul 20 12:52:55 EDT 2012

I took Matthias's test, compiled it from DrRacket "create executable"
option and ran it on my machine: Inspiron 1525 3Gbyte dual core about
6 years old.

#lang racket
(define l (time (build-list (* 4091 5023) (λ (x) 1))))
(system "PAUSE")

WORKS

#lang racket
(define l (time (build-list (* 7091 5023) (λ (x) 1))))
(system "PAUSE")

ABORTS with Racket Virtual Machine run out of memory

Thanks,
Harry

On Fri, Jul 20, 2012 at 9:51 AM, Matthias Felleisen
<matthias at ccs.neu.edu> wrote:
>
> 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 5.3.0.16--2012-07-18(b111241a/d) [3m].
> Language: racket.
>> (define l (time (build-list (* 4091 5023) (λ (x) 1))))
> cpu time: 19862 real time: 163710 gc time: 12883
>> (length l)
> 20549093
>> (* 4091 5023)
> 20549093
>
>
> 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.