From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: weis Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id SAA13845 for caml-redistribution; Sun, 17 May 1998 18:55:37 +0200 (MET DST) Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id UAA05544 for ; Fri, 15 May 1998 20:23:15 +0200 (MET DST) Received: from orleane.aurecvideo.fr (orleane.aurecvideo.fr [194.51.123.17]) by nez-perce.inria.fr (8.8.7/8.8.5) with ESMTP id UAA06176 for ; Fri, 15 May 1998 20:23:09 +0200 (MET DST) Received: from berruyer.aurecvideo.fr (ppp-233.aurec.avo.fr [194.51.123.233]) by orleane.aurecvideo.fr (8.8.5/8.8.5) with SMTP id PAA29430 for ; Fri, 15 May 1998 15:15:10 -0400 From: "Berruyer" To: "caml-list" Subject: A propos de la fonction stat() Date: Fri, 15 May 1998 20:23:45 +0200 Message-ID: <01bd802e$af385f00$e97b33c2@berruyer.aurecvideo.fr> MIME-Version: 1.0 X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 4.71.1712.3 X-MimeOLE: Produced By Microsoft MimeOLE V4.71.1712.3 Sender: weis [english version is below the french one] Bonjour, J'utilise Caml-light 0.74 sur Windows 95, et je voudrais savoir quelle confiance on peut accorder au résultat de la fonction stat(). La documentation indique que < (minor_words + major_words - promoted_words) * 4 > octets est la quantite de memoire allouee par le programme. Aussi, j'utilise une fonction memory() qui me donne tout de suite la = memoire allouee : let memory () = let s=stat() in let = m=float_of_int(((s.minor_words)+(s.major_words)-(s.promoted_words))*4) = in begin print_newline(); print_string "Mémoire actuellement utilisée par le = programme : "; print_float (tronque (m/.1024./.1024.)); print_string " Mo."; print_newline() end;; où la fonction "tronque" tronque un float à la deuxieme decimale. Cependant, dernierement, cette fonction m'a affirme que mon programme = allouait 879,25 Mo de mémoire. Evidemment, une telle quantité de mémoire = est absurde parce que je n'ai pas tant de place libre sur le dique dur. Qu'en est-il ? Merci d'avance pour vos réponses, Beno=EEt BERRUYER. [english version] Hello, I use Caml-light 0.74 with Windows 95, and i'd like to know to what = extent i can trust in the results of the stat() fonction. The Caml-doc explains that < (minor_words + major_words - promoted_words) * 4 > bytes is the amount of memory allocated by the program. So, i use a fonction memory() that immediately gives me the allocated = memory : let memory () = let s=stat() in let = m=float_of_int(((s.minor_words)+(s.major_words)-(s.promoted_words))*4) = in begin print_newline(); print_string "Amount of memory currently allocated : "; print_float (tronque (m/.1024./.1024.)); print_string " MB."; print_newline() end;; where the fonction "tronque" returns the float with only 2 figures after = the point. Yet, lately, this fonction returned that my program was allocating 879,25 MB of memory. Obviously, such an amount of memory is absurd because there is not so much free space on my hard disk. Then, is there an explaination ? Thanks in anticipation for your answers, Beno=EEt BERRUYER.