caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: "Berruyer" <berruyer@AVO.fr>
To: "caml-list" <caml-list@inria.fr>
Subject: A propos de la fonction stat()
Date: Fri, 15 May 1998 20:23:45 +0200	[thread overview]
Message-ID: <01bd802e$af385f00$e97b33c2@berruyer.aurecvideo.fr> (raw)

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 2291 bytes --]

[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.
                  





             reply	other threads:[~1998-05-17 16:55 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-05-15 18:23 Berruyer [this message]
1998-05-18  8:51 ` Francois Rouaix

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='01bd802e$af385f00$e97b33c2@berruyer.aurecvideo.fr' \
    --to=berruyer@avo.fr \
    --cc=caml-list@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).