chicken-users
[Top][All Lists]
Advanced

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

Re: [Chicken-users] Minimal Memory Footprint


From: Mario Domenech Goulart
Subject: Re: [Chicken-users] Minimal Memory Footprint
Date: Fri, 07 Sep 2012 16:24:36 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.91 (gnu/linux)

Hi Dominik,

On Fri, 07 Sep 2012 21:23:53 +0200 Dominik Off <address@hidden> wrote:

> I consider to use chicken scheme for small embedded hardware. However,
> I'm not complete sure how small I can get the size of the the compiled
> code as well as how the minimal memory footprint is. So, how much
> memory and flash do you need at least for chicken scheme? What do you
> think?

Here's the top entry on my system (Linux 32-bit) for a compiled
"program" which loops only:   

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
28599 mario     20   0  6504 1656 1116 R  100  0.1   0:39.40 loop

$ cat loop.scm 
(let loop () (loop))

$ csc -x -uses library loop.scm 

$ ls -l loop
-rwxrwxr-x 1 mario mario 12286 Set  7 17:05 loop

$ ldd loop
        linux-gate.so.1 =>  (0x00ca9000)
        libchicken.so.6 =>
        /usr/local/chicken-4.8.0rc3/lib/libchicken.so.6 (0x006f1000)
        libc.so.6 => /lib/i386-linux-gnu/libc.so.6 (0x00193000)
        libm.so.6 => /lib/i386-linux-gnu/libm.so.6 (0x00110000)
        libdl.so.2 => /lib/i386-linux-gnu/libdl.so.2 (0x00fd0000)
        /lib/ld-linux.so.2 (0x003ab000)

To run it, you basically need libchicken.so, which is ~4.1MB on recent
Chicken versions.  The full Chicken installation is ~13MB (no eggs).

It's probably possible to tweak things a little bit to use less memory
and disk space, but it will demands some work.

If you link your program statically, it may use less memory and storage
space in this case:

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
28808 mario     20   0  2072 1044  604 R  100  0.0   0:21.51 loop

$ csc -x -uses -static library loop.scm

$ ls -l loop 
-rwxrwxr-x 1 mario mario 1572519 Set  7 17:23 loop

$ ldd loop
        not a dynamic executable


That's just a do-nothing program.  Resource usage is really up to your
application's profile.


Best wishes.
Mario
-- 
http://parenteses.org/mario



reply via email to

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