From: Lionel Elie Mamane <lionel@mamane.lu>
To: Brian Hurt <bhurt@janestcapital.com>
Cc: Stefan Monnier <monnier@iro.umontreal.ca>, caml-list@inria.fr
Subject: Re: [Caml-list] Re: OCaml runtime using too much memory in 64-bit Linux
Date: Wed, 14 Nov 2007 18:08:47 +0100 [thread overview]
Message-ID: <20071114170847.GC16398@capsaicin.mamane.lu> (raw)
In-Reply-To: <473B2400.5050800@janestcapital.com>
On Wed, Nov 14, 2007 at 11:36:16AM -0500, Brian Hurt wrote:
> Stefan Monnier wrote:
>> How about allocating this array of bytes via mmap and then leave it
>> uninitialized (relying on POSIX's guarantee that it's already
>> initialized to zeros)?
>> This way you can easily have a 4GB "dense" table which doesn't use much
>> RAM since most of the 4GB will be mapped (via copy-on-write) to the same
>> "zero page".
> Even on a system like linux, which optimistically allocates memory
> (i.e. the actually underlying memory isn't allocated until you
> actually touch it), once you read the page, it has to actually exist
> in memory.
This may not be a problem (but only people that know the system
intimately will *know*), it is plausible that the ocaml runtime system
would not read any entry in the table corresponding to a page that is
not allocated. Or maybe not.
--
Lionel
next prev parent reply other threads:[~2007-11-14 17:08 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
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 [this message]
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=20071114170847.GC16398@capsaicin.mamane.lu \
--to=lionel@mamane.lu \
--cc=bhurt@janestcapital.com \
--cc=caml-list@inria.fr \
--cc=monnier@iro.umontreal.ca \
/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