[racket] Racket Virtual Machine runs out of memory
I've commented everything out except the calls to FFI to ImageMagick
that create the imput for the procedure that creates the list and the
procedure that creates the list. Basicallya:
MagickReadImage
MagickDeskewImage
MegickExportPixels
The MagickExportPixels does create another list as long as the one
blowing up. But I've isolated the running out of memory as past that
function call. So AFAICT the memory abort occurs when there already is
a list of lists of about 20M x 1 (created by ImageMagick) and then
when I try to create mine of (4091 x 5023).
I'm running this on an inspiron 1525 about 6 years old with dual core
and 3Gbytes.
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
>