caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] "Nasty" functions and memory usage
@ 2001-03-17  1:35 Alex Baretta
       [not found] ` <E14exRm-0001kT-00@ithif51>
  2001-03-22 14:22 ` Xavier Leroy
  0 siblings, 2 replies; 4+ messages in thread
From: Alex Baretta @ 2001-03-17  1:35 UTC (permalink / raw)
  To: caml-list

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
calculated.)

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

  PID USER     PRI  NI  SIZE  RSS SHARE STAT  LIB %CPU %MEM   TIME
COMMAND
 1902 root      19   0  2220 2220   512 R       0 92.1  0.8  16:29
ocaml
 1936 root       5   0   868  868   668 S       0  3.7  0.3   0:20
top

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

Please, gurus, explain...

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


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2001-03-22 14:22 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-03-17  1:35 [Caml-list] "Nasty" functions and memory usage Alex Baretta
     [not found] ` <E14exRm-0001kT-00@ithif51>
2001-03-19 15:25   ` Alex Baretta
2001-03-19 16:01     ` Sebastien Carlier
2001-03-22 14:22 ` Xavier Leroy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).