Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: Andres Varon <avaron@gmail.com>
To: Jean Krivine <jean_krivine@hms.harvard.edu>
Cc: caml-list@yquem.inria.fr
Subject: Re: [Caml-list] memory usage
Date: Wed, 16 Jul 2008 14:44:38 -0400	[thread overview]
Message-ID: <85BCED35-B8FD-4734-984C-581569C35C13@gmail.com> (raw)
In-Reply-To: <dc2907b70807161107v41ee51f5n3f28f9857408412f@mail.gmail.com>



On Jul 16, 2008, at 2:07 PM, Jean Krivine wrote:

> Good news, I just tested the patch and it works great with my  
> application!
> I just had to modify the module random since a call to (Random.int
> max_int) may raise and exception (it is made for 32 bits integers).
> So I guess that modification should be included in the patch.

I don't think that's a good idea. You have to use Random.int64 to get  
a 64 bit random integer. The Random.int function will return an  
integer between 0 and 2^30. Check the Random module documentation here:

http://caml.inria.fr/pub/docs/manual-ocaml/libref/Random.html

I wouldn't play with a random number generator unless I know exactly  
what I'm doing. Your results depend on it! (well, your messed-up-by- 
andres compiler could already have issues ... :-(, for what I use it I  
can verify the result with a 32 bit binary or a 64 bit linux binary,  
if you can, then do the same!).


Andres
>
>
> Thanks a lot Andres.
> Jean
>
> On Wed, Jul 16, 2008 at 12:27 PM, Jean Krivine
> <jean_krivine@hms.harvard.edu> wrote:
>> Great thanks!
>>
>> J
>>
>> On Wed, Jul 16, 2008 at 10:16 AM, Andres Varon <avaron@gmail.com>  
>> wrote:
>>>
>>> On Jul 15, 2008, at 3:38 PM, Jean Krivine wrote:
>>>
>>>> I'd be glad to try the patch if you could post it somewhere!
>>>
>>> I have posted it in:
>>>
>>> http://research.amnh.org/~avaron/ocaml/
>>>
>>> best,
>>>
>>> Andres
>>>>
>>>> J
>>>>
>>>> On Tue, Jul 15, 2008 at 3:31 PM, Andres Varon <avaron@gmail.com>  
>>>> wrote:
>>>>>
>>>>> Hello Jean,
>>>>>
>>>>> There is no 64-bit native OCaml compiler for Mac OS X intel.  I  
>>>>> have a
>>>>> patch
>>>>> that works in Leopard, but did not compile opt.opt in Tiger,  
>>>>> meaning that
>>>>> something is not OK,  so I did not offer it to the community. The
>>>>> bootstrap
>>>>> went fine, findlib and godi compiled OK too. I can post the  
>>>>> patches
>>>>> somewhere if you want to give it a shot.
>>>>>
>>>>> My memory intensive application runs fine in Leopard with this  
>>>>> compiler.
>>>>> But
>>>>> the binaries do not execute in Tiger (I found that other people  
>>>>> had the
>>>>> same
>>>>> trouble copying a 64 bit apps from Leopard to Tiger and the  
>>>>> other way
>>>>> around, but didn't look into it).
>>>>>
>>>>> If you want it ... I can post it, maybe someone can cleanup my  
>>>>> job? All
>>>>> that
>>>>> would be needed after patching is:
>>>>>
>>>>> ./configure -host x86_64-apple-darwin -prefix /opt/ocaml/ 
>>>>> experimental
>>>>>
>>>>> (The prefix I always add for my ocaml-modified comilers).
>>>>>
>>>>> best,
>>>>>
>>>>> Andres
>>>>>
>>>>> On Jul 15, 2008, at 1:06 PM, Jean Krivine wrote:
>>>>>
>>>>>> Dear all
>>>>>>
>>>>>> I downloaded the last version of ocaml (3.10.2) but I must  
>>>>>> confess I
>>>>>> don't know what option I should pass to the compiler to make a  
>>>>>> binary
>>>>>> that uses 64 bits.
>>>>>> I tried naively ocamlopt -ccopt -arch -ccopt x86_64 but that  
>>>>>> doesn't
>>>>>> work. Any idea?
>>>>>>
>>>>>>
>>>>>>
>>>>>> On Fri, Jul 11, 2008 at 6:01 PM, Richard Jones  
>>>>>> <rich@annexia.org> wrote:
>>>>>>>
>>>>>>> On Fri, Jul 11, 2008 at 03:49:26PM -0400, Jean Krivine wrote:
>>>>>>>>
>>>>>>>> I am trying to run a stochastic simulator (written in ocaml)  
>>>>>>>> on a huge
>>>>>>>> data set and I have the following error message:
>>>>>>>
>>>>>>> I can confirm that OCaml works fine with huge datasets, on 64  
>>>>>>> bit
>>>>>>> platforms anyway.
>>>>>>>
>>>>>>>> sim(9595) malloc: *** mmap(size=1048576) failed (error code=12)
>>>>>>>> *** error: can't allocate region
>>>>>>>> *** set a breakpoint in malloc_error_break to debug
>>>>>>>> Fatal error: out of memory.
>>>>>>>>
>>>>>>>> My system:
>>>>>>>>
>>>>>>>> Mac Pro running OS X 10.5.4
>>>>>>>> Processor:  2 x 2.8 GHz Quad-Core Intel Xeon
>>>>>>>> Memory:  10 GB 800 MHz DDR2 FB-DIMM
>>>>>>>>
>>>>>>>> Does someone know what happened? Do you have any idea of any  
>>>>>>>> parameter
>>>>>>>> I could tune in order to avoid that?
>>>>>>>
>>>>>>> Is the compiler 32 bits or 64 bits on this machine?  Try doing:
>>>>>>>
>>>>>>> $ ocaml
>>>>>>> # Sys.word_size ;;
>>>>>>>
>>>>>>> It should print out either '32' or '64'.
>>>>>>>
>>>>>>> Also run your program under whatever the OS X equivalent of  
>>>>>>> 'strace'
>>>>>>> is (ktrace?) to find out exactly why the mmap call fails.
>>>>>>>
>>>>>>> OCaml <= 3.10.2 on Linux suffers a nasty problem with its use  
>>>>>>> of mmap
>>>>>>> and randomized address spaces
>>>>>>> (https://bugzilla.redhat.com/show_bug.cgi?id=445545#c9) but it  
>>>>>>> doesn't
>>>>>>> seem like this is the same issue.
>>>>>>>
>>>>>>> Rich.
>>>>>>>
>>>>>>> --
>>>>>>> Richard Jones
>>>>>>> Red Hat
>>>>>>>
>>>>>>> _______________________________________________
>>>>>>> Caml-list mailing list. Subscription management:
>>>>>>> http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
>>>>>>> Archives: http://caml.inria.fr
>>>>>>> Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
>>>>>>> Bug reports: http://caml.inria.fr/bin/caml-bugs
>>>>>>>
>>>>>>
>>>>>> _______________________________________________
>>>>>> Caml-list mailing list. Subscription management:
>>>>>> http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
>>>>>> Archives: http://caml.inria.fr
>>>>>> Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
>>>>>> Bug reports: http://caml.inria.fr/bin/caml-bugs
>>>>>
>>>>>
>>>
>>>
>>


  reply	other threads:[~2008-07-16 18:44 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-11 19:49 Jean Krivine
2008-07-11 21:49 ` [Caml-list] " Till Varoquaux
2008-07-11 22:01 ` Richard Jones
2008-07-15 17:06   ` Jean Krivine
2008-07-15 19:31     ` Andres Varon
2008-07-15 19:38       ` Jean Krivine
2008-07-16 14:16         ` Andres Varon
2008-07-16 16:27           ` Jean Krivine
2008-07-16 18:07             ` Jean Krivine
2008-07-16 18:44               ` Andres Varon [this message]
2008-07-16 18:54                 ` Jean Krivine
2009-01-12  7:41 John Lepikhin
2009-01-12  8:39 ` [Caml-list] " Richard Jones
2009-01-12  9:14   ` John Lepikhin
     [not found] ` <20090112114837.GB18405@janestcapital.com>
2009-01-12 15:05   ` John Lepikhin
2009-01-12 16:29 ` Florian Hars
2009-01-12 16:44   ` John Lepikhin
2017-01-30 16:39 [Caml-list] Memory Usage Umair Siddique
2017-01-30 16:42 ` Van Chan Ngo
2017-01-30 16:50   ` Evgeny Roubinchtein
2017-01-31 18:09     ` Umair Siddique
2017-02-01  9:04 ` Alain Frisch

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=85BCED35-B8FD-4734-984C-581569C35C13@gmail.com \
    --to=avaron@gmail.com \
    --cc=caml-list@yquem.inria.fr \
    --cc=jean_krivine@hms.harvard.edu \
    /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