Version française
Home     About     Download     Resources     Contact us    
Browse thread
OCaml runtime using too much memory in 64-bit Linux
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Samuel Mimram <samuel.mimram@e...>
Subject: Re: [Caml-list] OCaml runtime using too much memory in 64-bit Linux
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/