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!<div>
<br></div><div>Nevo<br><br><div class="gmail_quote">On 23 April 2011 18:55, Kevin Tew <span dir="ltr"><<a href="mailto:tewk@cs.utah.edu">tewk@cs.utah.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div text="#000000" bgcolor="#FFFFFF">
BLOCK_CACHE IS enabled by default in 5.1.1.3.<br>
#define MZ_USE_PLACES (the default as of 5.1.1.3) enables block
cache (see top of gc2/vm.c file).<br>
<br>
If you have a pre 5.1.1 version or have places disabled, then my
block cache patch won't be of any help.<br><font color="#888888">
<br>
Kevin</font><div><div></div><div class="h5"><br>
<br>
<br>
<br>
On 04/23/2011 01:09 AM, Nevo wrote:
<blockquote type="cite">hi Kevin:<br>
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!<br>
<br>
Nevo<br>
<br>
<div class="gmail_quote">On 23 April 2011 14:27, Nevo <span dir="ltr"><<a href="mailto:sakur.deagod@gmail.com" target="_blank">sakur.deagod@gmail.com</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
hi Robby<br>
Just back from out of town, sorry for the late reply.<br>
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.<br>
<font color="#888888">
<br>
Nevo</font>
<div>
<div><br>
<br>
<div class="gmail_quote">On 22 April 2011 19:08, Robby
Findler <span dir="ltr"><<a href="mailto:robby@eecs.northwestern.edu" target="_blank">robby@eecs.northwestern.edu</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
This program:<br>
<br>
#lang racket/base<br>
(printf "hi\n")<br>
<br>
uses a lot less memory than this one:<br>
<br>
#lang racket<br>
(printf "hi\n")<br>
<br>
Does that help at all?<br>
<br>
Robby<br>
<div>
<div><br>
On Fri, Apr 22, 2011 at 12:09 AM, Nevo <<a href="mailto:sakur.deagod@gmail.com" target="_blank">sakur.deagod@gmail.com</a>>
wrote:<br>
> hi<br>
> My attempt on porting Racket interpreter to
iOS has been for a while and<br>
> I've been able to run interpreter on both iOS
device as well iOS simulator.<br>
> Right now, it runs perfectly on iOS
simulator, but lack of satisfaction on<br>
> device. The reason is for those devices like
iPad/iPhone or Android, the<br>
> memory for standalone application is always
constrained, and even a single<br>
> "hello world" evaluation would easily put the
whole app runtime to death,<br>
> per my test. In particular, here I've got
some commented out "printf" code<br>
> compiled in for newgc.c, and trying to load a
simple "hello world" racket<br>
> file to evaluate results in more than 30MB
memory in use (reported by gc).<br>
> This is nothing for a desktop, but will kill
itself easily in iOS which<br>
> usually requires the average memory
allocation will be less than 20MB. So<br>
> I'm asking if there's some known compiling or
runtime configuration which I<br>
> may not know to reduce memory usage, at least
keep average allocation<br>
> acceptable for those memory constrained
devices. Thanks for your suggests<br>
> here!<br>
> Nevo<br>
</div>
</div>
> _________________________________________________<br>
> For list-related administrative tasks:<br>
> <a href="http://lists.racket-lang.org/listinfo/dev" target="_blank">http://lists.racket-lang.org/listinfo/dev</a><br>
><br>
</blockquote>
</div>
<br>
</div>
</div>
</blockquote>
</div>
<br>
</blockquote>
<br>
</div></div></div>
</blockquote></div><br></div>