caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* OCaml runtime using too much memory in 64-bit Linux
@ 2007-11-07 17:28 Adam Chlipala
  2007-11-07 18:20 ` [Caml-list] " Gerd Stolpmann
  2007-11-08 20:51 ` [Caml-list] " Romain Beauxis
  0 siblings, 2 replies; 17+ messages in thread
From: Adam Chlipala @ 2007-11-07 17:28 UTC (permalink / raw)
  To: caml-list

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

A program that should be using just a few megabytes of RAM ends up using 
200+ MB to store a page table.  It seems that a C macro is defined by 
default on 64-bit Linux to use mmap() instead of malloc().  Ironically, 
a comment says that this was done to avoid being given blocks of memory 
that are very far apart from each other, forcing the creation of overly 
large page tables.  It's ironic because that is exactly the problem that 
is showing up now with mmap().  It ends up called twice for the program 
I'm looking at, and the two addresses it returns are far enough apart to 
lead to creation of a 200 MB page table.

Has anyone else experienced this problem?  Would the runtime system need 
to be changed to avoid it?


^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2007-11-14 17:26 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-11-07 17:28 OCaml runtime using too much memory in 64-bit Linux 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
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

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