Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: Richard Jones <rich@annexia.org>
To: Markus Mottl <markus.mottl@gmail.com>
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] ocamlc.opt tries to allocate 34 GB of RAM ... and fails
Date: Thu, 8 May 2008 14:55:38 +0100	[thread overview]
Message-ID: <20080508135538.GF20312@annexia.org> (raw)
In-Reply-To: <f8560b80805080640g24a5502di359734a49b926d44@mail.gmail.com>

On Thu, May 08, 2008 at 09:40:12AM -0400, Markus Mottl wrote:
> On Thu, May 8, 2008 at 6:14 AM, Richard Jones <rich@annexia.org> wrote:
> >   Growing heap to 4320k bytes
> >   Growing page table to 34359705221 entries
> >   No room for growing page table
> >   Fatal error: out of memory.
> 
> Yeah, that's an indication that you've hit the mentioned problem
> (addresses of allocated memory too far apart).

Yes, we came a similar conclusion.

However there is a MAP_32BIT flag that you can add to mmap which makes
it return low memory addresses.  There are two problems with this,
namely (a) the flag is only available on x86-64 (and we have the same
problem on ppc64), and (b) it limits the whole heap to 1 or 2 GB.
Nevertheless this is the solution we have gone with for now.

  http://lxr.linux.no/linux/include/asm-x86_64/mman.h#L6
  https://bugzilla.redhat.com/attachment.cgi?id=304848
  https://bugzilla.redhat.com/show_bug.cgi?id=445545#c9

Hopefully OCaml 3.11 will arrive before Fedora 10 is released, in
which case we'll just upgrade.

> >  Unfortunately I have no idea how to solve this, certainly it seems
> >  there is no simple fix ...  (I tried to set vm.overcommit_memory
> >  policy, but that doesn't work because the page table is initialized
> >  right after allocation).
> 
> If my mmap "fix" (not guaranteed to work with all kernels) is in the
> executing runtime, then, I'm afraid, there is little you can do other
> than switching to a CVS-version of the upcoming OCaml-release.  Xavier
> has implemented a completely new page table representation there,
> which should solve this problem once and for all.

Backporting all that hash table code into OCaml 3.10 didn't look like
fun to me :-(

Rich.

-- 
Richard Jones
Red Hat


      reply	other threads:[~2008-05-08 13:55 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-07 17:01 Richard Jones
2008-05-07 17:35 ` [Caml-list] " Romain Beauxis
2008-05-07 18:34   ` Richard Jones
2008-05-07 18:46     ` Markus Mottl
2008-05-07 18:49       ` Richard Jones
2008-05-07 19:24         ` Markus Mottl
2008-05-07 19:29           ` Brian Hurt
2008-05-08  9:14           ` Richard Jones
2008-05-08 10:14             ` Richard Jones
2008-05-08 13:40               ` Markus Mottl
2008-05-08 13:55                 ` Richard Jones [this message]

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=20080508135538.GF20312@annexia.org \
    --to=rich@annexia.org \
    --cc=caml-list@inria.fr \
    --cc=markus.mottl@gmail.com \
    /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