[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: RAM usage of applications?

From: felix . winkelmann
Subject: Re: RAM usage of applications?
Date: Sat, 30 Nov 2019 16:41:28 +0100

> Il 30/11/19 01:21, address@hidden ha scritto:
> > egarrulo <address@hidden> wrote:
> >> Can anybody give me a *rough* idea of how much RAM a basic program
> >> written in Chicken and transpiled to C could require at run-time? Some
> >> megabytes, dozens of megabytes, etc.  With all features enabled, if
> >> feasible.  Speed is not a concern.
> > What exactly do you mean by “all features enabled”?
> I mean full support for every language feature. I guess that some
> language features - like "eval" and macros - may impact memory
> requirements significantly. Please note that I am not a Scheme
> programmer (yet).

On my OpenBSD system, a simple read-eval-print-loop, statically
linked to the CHICKEN runtime (libchicken.a) is 2692416 bytes.
"ps u" reports VSZ (virtual memory) 4248kb, RSS (resident memory) 4848kb
after startup. After allocating a vector of 1000000 elements and assigning
it to a variable, VSZ is 30760k, RSS 12768k. The heap grows dynamically,
but can be set to a fixed size by a runtime option. Clearing the variable
and invoking a GC leaves us with VSZ 16999kb and RSS 4955kb,

Not sure if this helps a lot, but the size of the base image is relatively
modest, how much you can stuff into your RAM depends less on code size
but on the working set, i.e. how much memory you allocate dynamically.
CHICKEN's GC is a semispace collector where memory gets copied on GC
from one space to the other, so half of the available heap memory is unused at
any time.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]