Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: Edgar Friendly <thelema314@gmail.com>
To: caml-list@inria.fr
Subject: Re: [Caml-list] Memory usage of ocaml program
Date: Fri, 23 Nov 2012 10:29:54 -0500	[thread overview]
Message-ID: <50AF9672.4020800@gmail.com> (raw)
In-Reply-To: <CAPFanBEgHoYOpojRMNFFeEN8Nv3fgn1whESy_P7Lp7KZWTmBgg@mail.gmail.com>

Also Bigarrays, although this falls under "libraries that use C bindings".

E.

On 11/23/2012 1:40 AM, Gabriel Scherer wrote:
> If you use the C bindings (or a library that does), you may have
> allocated memory from C, outside the OCaml heap. This memory is not
> handled by the GC and will not appear in the GC stats.
>
> On Fri, Nov 23, 2012 at 3:34 AM, Chengqi Song <songcq@gmail.com> wrote:
>> I have the same program (same binary) running in different modes. From
>> GC stats I see they're using the same amount of heap now (209m) and
>> the stack is small. But in top's RES column, I see one is using 270m
>> memory and the other one is using 622m. Forcing heap compaction does
>> not change the numbers.
>>
>> I don't quite understand this difference. A program's memory usage
>> should be code, static data, heap and stack. For the same binary, code
>> and static data segment should be the same, and now that GC stats
>> tells me heap and stack are the same, why there is a 352m difference
>> in memory usage?
>>
>> Thanks


  reply	other threads:[~2012-11-23 15:30 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-23  2:34 Chengqi Song
2012-11-23  6:40 ` Gabriel Scherer
2012-11-23 15:29   ` Edgar Friendly [this message]
2012-11-23 16:05 ` Gerd Stolpmann

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=50AF9672.4020800@gmail.com \
    --to=thelema314@gmail.com \
    --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