[racket] Out of memory

From: Jos Koot (jos.koot at telefonica.net)
Date: Mon Apr 4 10:19:12 EDT 2011

I think you have to increase the memory limit. With limit 128 Mb Racketb
consequently runs out of memory on my system.
The program runs well with limit 256 Mb.
Jos

> -----Original Message-----
> From: users-bounces at racket-lang.org 
> [mailto:users-bounces at racket-lang.org] On Behalf Of Pierpaolo Bernardi
> Sent: 04 April 2011 16:05
> To: users at racket-lang.org
> Subject: [racket] Out of memory
> 
> Hello,
> 
> in this racket:
> 
> Welcome to DrRacket, version 5.1.0.4--2011-03-26(fe75ed9/a) [3m].
> Language: racket [custom]; memory limit: 128 MB.
> (windows XP)
> 
> this program:
> 
> #lang racket
> 
> (define (test n exp)
>   (let ((v (make-vector n)))
>     (for ((i (in-range n)))
>       (vector-set! v i (expt (random) exp)))
>     (let sum ((i 0) (all 0.0) (pos 0.0) (neg 0.0))
>       (if (= i n)
>         (values all (+ pos neg))
>         (let ((item (vector-ref v i)))
>           (if (positive? item)
>             (sum (+ i 1) (+ all item) (+ pos item) neg)
>             (sum (+ i 1) (+ all item) pos (+ neg item))))))))
> 
> (test 10000000 -1)
> 
> sometimes signals an out of memory, and sometimes it runs to 
> completion.
> 
> The cheching or unchecking of 'Debugging and profiling' and 'Preserve
> stacktrace'
> does not change this.
> 
> The function looks fine to me. So, what is the problem?
> 
> Thanks!
> 
> P.
> _________________________________________________
>   For list-related administrative tasks:
>   http://lists.racket-lang.org/listinfo/users



Posted on the users mailing list.