caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Samuel Mimram <samuel.mimram@ens-lyon.org>
To: caml-list@inria.fr
Cc: Adam Chlipala <achlipala@janestcapital.com>,
	Gerd Stolpmann <info@gerd-stolpmann.de>
Subject: Re: [Caml-list] OCaml runtime using too much memory in 64-bit Linux
Date: Thu, 08 Nov 2007 12:56:39 +0000	[thread overview]
Message-ID: <47330787.6050305@ens-lyon.org> (raw)
In-Reply-To: <47320E10.1050307@janestcapital.com>

Hi,

Adam Chlipala wrote:
> Gerd Stolpmann wrote:
>> Am Mittwoch, den 07.11.2007, 12:28 -0500 schrieb Adam Chlipala:
>>  
>>> I've encountered a problem where certain OCaml programs use orders of 
>>> magnitude more RAM when compiled/run in 64-bit Linux instead of 
>>> 32-bit Linux.  Some investigation led to the conclusion that the 
>>> difference has to do with the size of OCaml page tables.  (Here I 
>>> mean the page tables maintained by the OCaml runtime system, not any 
>>> OS stuff.)
>>>
>>> ...
>>>     
>>
>> We are using O'Caml on 64 bit Linux, and aren't aware of such problems.
>>
>> Did you observe a debug GC message that proves it? 200 MB means that an
>> address space of 200M * 4K = 8E is covered.

We are observing the same memory consumption problems with 
liquidsoap[1]. On 32-bits machines ps says that it takes around 50M / 
10M of VSZ / RSS whereas on 64-bits machines it takes 200M / 100M which 
is much much bigger!

Here is the initial stack an heap allocation on 32-bits archs:

% OCAMLRUNPARAM="v=12" ./liquidsoap 'output.dummy(blank())'
Growing heap to 480k bytes
Growing page table to 3040 entries
Growing heap to 720k bytes
Growing page table to 3354 entries
Growing heap to 960k bytes
Growing page table to 3532 entries
Growing heap to 1200k bytes
Growing page table to 4251 entries
Growing heap to 1440k bytes
Growing page table to 4416 entries
Growing heap to 1680k bytes
Growing page table to 4478 entries
Growing heap to 1920k bytes
Growing page table to 4540 entries

And on 64-bits archs:

$ OCAMLRUNPARAM="v=12" ./liquidsoap 'output.dummy(blank())'
Growing heap to 960k bytes
Growing page table to 118256149 entries
Growing heap to 1440k bytes

I'm not sure I fully understand what these figures are. Is it expected 
for the page table to be bigger with that many orders of magnitude on 
64-bits archs?

Thanks!

Samuel.

[1] http://savonet.sf.net/


  reply	other threads:[~2007-11-08 12:56 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-07 17:28 Adam Chlipala
2007-11-07 18:20 ` [Caml-list] " Gerd Stolpmann
2007-11-07 19:12   ` Adam Chlipala
2007-11-08 12:56     ` Samuel Mimram [this message]
2007-11-14  4:20     ` Romain Beauxis
2007-11-14 12:03       ` Vladimir Shabanov
2007-11-14 12:55         ` Xavier Leroy
2007-11-14 13:45           ` Brian Hurt
2007-11-14 14:16           ` Romain Beauxis
2007-11-14 15:56           ` Markus Mottl
2007-11-14 16:22           ` Stefan Monnier
2007-11-14 16:36             ` [Caml-list] " Brian Hurt
2007-11-14 17:08               ` Lionel Elie Mamane
2007-11-14 17:26               ` Stefan Monnier
2007-11-14 16:45             ` Lionel Elie Mamane
2007-11-14 17:08               ` Lionel Elie Mamane
2007-11-08 20:51 ` [Caml-list] " Romain Beauxis

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=47330787.6050305@ens-lyon.org \
    --to=samuel.mimram@ens-lyon.org \
    --cc=achlipala@janestcapital.com \
    --cc=caml-list@inria.fr \
    --cc=info@gerd-stolpmann.de \
    /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).