Browse thread
OCaml runtime using too much memory in 64-bit Linux
[
Home
]
[ Index:
by date
|
by threads
]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
| Date: | -- (:) |
| From: | Lionel Elie Mamane <lionel@m...> |
| Subject: | Re: [Caml-list] Re: OCaml runtime using too much memory in 64-bit Linux |
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