[racket-dev] Memory consumption of Racket

From: Nevo (sakur.deagod at gmail.com)
Date: Sat Apr 23 09:00:06 EDT 2011

Yeah, I've already found that in vm.c . I'll have to enable place, but right
now, as you may notice, I'm trying to run Racket engine on iOS, and I want
to start from the simple hygienic interpreter. Actually, I'm curious about
why even a "hello world" test requires more than 30MB memory. I've ever got
Guile (GNU Scheme implementation) 1.6 running on iPhone (not iPad) last year
without "out of memory" issue. Maybe it is possible to reduce some
unnecessary allocation? Can I make "APAGE_SIZE" smaller instead of current
16K? Thanks!

Nevo

On 23 April 2011 18:55, Kevin Tew <tewk at cs.utah.edu> wrote:

>  BLOCK_CACHE IS enabled by default in 5.1.1.3.
> #define MZ_USE_PLACES (the default as of 5.1.1.3) enables block cache (see
> top of gc2/vm.c file).
>
> If you have a pre 5.1.1 version or have places disabled, then my block
> cache patch won't be of any help.
>
> Kevin
>
>
>
>
> On 04/23/2011 01:09 AM, Nevo wrote:
>
> hi Kevin:
>   Your patch seems requiring "USE_BLOCK_CACHE" to be enabled. Sorry for my
> lack of knowledge into Racket's memory management component, how can I
> safely enable that because I cannot find its reference in configure or
> Makefile.in? Thanks!
>
> Nevo
>
> On 23 April 2011 14:27, Nevo <sakur.deagod at gmail.com> wrote:
>
>> hi Robby
>>   Just back from out of town, sorry for the late reply.
>>   No. This doesn't help at all, still got low-memory killing on my ipad.
>> Actually, my own test is all based on "#lang racket/base". I'll try Kevin's
>> patch to see any difference. I've also tried to throttle the
>> max_pages_in_heap to allow around 25MB pages to use, it will soon throw "out
>> of memory" exception and abort after a couple of GC cycles.
>>
>> Nevo
>>
>>
>> On 22 April 2011 19:08, Robby Findler <robby at eecs.northwestern.edu>wrote:
>>
>>> This program:
>>>
>>>  #lang racket/base
>>>  (printf "hi\n")
>>>
>>> uses a lot less memory than this one:
>>>
>>>  #lang racket
>>>  (printf "hi\n")
>>>
>>> Does that help at all?
>>>
>>> Robby
>>>
>>> On Fri, Apr 22, 2011 at 12:09 AM, Nevo <sakur.deagod at gmail.com> wrote:
>>> > hi
>>> >   My attempt on porting Racket interpreter to iOS has been for a while
>>> and
>>> > I've been able to run interpreter on both iOS device as well iOS
>>> simulator.
>>> > Right now, it runs perfectly on iOS simulator, but lack of satisfaction
>>> on
>>> > device. The reason is for those devices like iPad/iPhone or Android,
>>> the
>>> > memory for standalone application is always constrained, and even a
>>> single
>>> > "hello world" evaluation would easily put the whole app runtime to
>>> death,
>>> > per my test. In particular, here I've got some commented out "printf"
>>> code
>>> > compiled in for newgc.c, and trying to load a simple "hello world"
>>> racket
>>> > file to evaluate results in more than 30MB memory in use (reported by
>>> gc).
>>> > This is nothing for a desktop, but will kill itself easily in iOS which
>>> > usually requires the average memory allocation will be less than 20MB.
>>> So
>>> > I'm asking if there's some known compiling or runtime configuration
>>> which I
>>> > may not know to reduce memory usage, at least keep average allocation
>>> > acceptable for those memory constrained devices. Thanks for your
>>> suggests
>>> > here!
>>> > Nevo
>>>  > _________________________________________________
>>> >  For list-related administrative tasks:
>>> >  http://lists.racket-lang.org/listinfo/dev
>>> >
>>>
>>
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/dev/archive/attachments/20110423/2983418a/attachment-0001.html>

Posted on the dev mailing list.