Version française
Home     About     Download     Resources     Contact us    
Browse thread
memory usage
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Richard Jones <rich@a...>
Subject: Re: [Caml-list] Re: memory usage
On Tue, Jan 13, 2009 at 01:56:39AM +0800, John Lepikhin wrote:
> > I'm afraid to say that you'll have to post a short reproducer here
> > before I can look at this further ...
> 
> I'm not sure this is the same issue. Look at this test code:

For reasons I don't fully understand, this code doesn't seem to do
anything.  A print statement after the Unix.openfile is never printed.

> let read_data _ =
> 	let fd = Unix.openfile "/dev/random" [] 0o644 in

You probably want to use something like /dev/urandom or /dev/zero
here.  This blocks after a very short time because /dev/random (on
Linux) only produces characters while there is entropy in the kernel.
(Not for very long once you start reading blocks of it from 20
threads).

Rich.

-- 
Richard Jones
Red Hat