English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
[Caml-list] "Nasty" functions and memory usage
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2001-03-17 (01:37)
From: Alex Baretta <alex@b...>
Subject: [Caml-list] "Nasty" functions and memory usage
I have been waiting some ten minutes or so, now, for my Pentium
200 to calculate the type of nasty function number 5...

let f0 = function x,y -> x,y;;
let f1 = function x,y -> f1(f0 x, f0 y);;
let ...
let f5 = function x,y -> f5(f4 x, f4 y);;

... and I have reason to believe I will still have to wait a long
long time if I want to see the result.

The question is the following: the problem of calculating the type
of fN is DSPACE(2**(2**N))-hard, as far as I understand ...(I have
evidence, too! The type of f4 was so long it took the machine
several minutes only to print it to the screen once it had it

So how can the memory usage of the ocaml interpreter be constant
at 2200Kb? Here's my top screen...

  2:31am  up 15:37,  5 users,  load average: 1.08, 1.05, 0.71
57 processes: 54 sleeping, 3 running, 0 zombie, 0 stopped
CPU states: 95.5% user,  4.4% system,  0.0% nice,  0.0% idle
Mem:   257720K av,  197864K used,   59856K free,   59456K shrd,  
68852K buff
Swap:  264804K av,    1848K used,  262956K free                  
72172K cached

 1902 root      19   0  2220 2220   512 R       0 92.1  0.8  16:29
 1936 root       5   0   868  868   668 S       0  3.7  0.3   0:20

The value has been constant at least since I started checking it,
about ten minutes ago.

Please, gurus, explain...

To unsubscribe, mail caml-list-request@inria.fr.  Archives: http://caml.inria.fr