From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by yquem.inria.fr (Postfix) with ESMTP id A3501BBAF for ; Wed, 11 Aug 2010 14:21:44 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AvwBAAIzYkzZSMDjkWdsb2JhbACgPBUBAQEBCQsKBxEDH7srhToE X-IronPort-AV: E=Sophos;i="4.55,352,1278280800"; d="scan'208";a="65275315" Received: from fmmailgate02.web.de ([217.72.192.227]) by mail1-smtp-roc.national.inria.fr with ESMTP; 11 Aug 2010 14:21:44 +0200 Received: from smtp03.web.de ( [172.20.0.65]) by fmmailgate02.web.de (Postfix) with ESMTP id C08E616DE9F4E; Wed, 11 Aug 2010 14:21:43 +0200 (CEST) Received: from [78.43.204.177] (helo=frosties.localdomain) by smtp03.web.de with asmtp (TLSv1:AES256-SHA:256) (WEB.DE 4.110 #24) id 1OjAJT-0007Sq-00; Wed, 11 Aug 2010 14:21:43 +0200 Received: from mrvn by frosties.localdomain with local (Exim 4.72) (envelope-from ) id 1OjAJR-0004NS-1N; Wed, 11 Aug 2010 14:21:41 +0200 From: Goswin von Brederlow To: Paul Steckler Cc: "caml-list@yquem.inria.fr" Subject: Re: [Caml-list] GC hangs application References: <2EB36A07AAE8C44BBB1986425E7A22D0128715A3DE@atp-mbx1.in.nicta.com.au> Date: Wed, 11 Aug 2010 14:21:40 +0200 In-Reply-To: <2EB36A07AAE8C44BBB1986425E7A22D0128715A3DE@atp-mbx1.in.nicta.com.au> (Paul Steckler's message of "Wed, 11 Aug 2010 19:30:44 +1000") Message-ID: <87pqxpnxuz.fsf@frosties.localdomain> User-Agent: Gnus/5.110009 (No Gnus v0.9) XEmacs/21.4.22 (linux, no MULE) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: goswin-v-b@web.de X-Sender: goswin-v-b@web.de X-Provags-ID: V01U2FsdGVkX1/19qcPgooPs3iUFgTsqd08kRDdGysuUAnDdIIV eWgUggb3gzD7bCNrQjsjvXXR0INjmV4P8vEX9E/mhxQR6q+F5D LKzs3hIJc= X-Spam: no; 0.00; steckler:01 steckler:01 ocaml:01 verbose:01 byte-code:01 rewrote:01 ocaml:01 stubs:01 stubs:01 strace:01 12.:98 mfg:98 garbage:01 garbage:01 unix:01 Paul Steckler writes: > I have an OCaml application that does a lot of string manipulations, generating a > lot of garbage. After running awhile, it seems not to make any progress. The exact > point where it hangs varies. The strings aren't very large, but there a lot of them. > > By increasing the size of the minor heap, the application runs much longer. > And if I turn on Gc.verbose, I see output from the garbage collector just before > the app hangs. I mean, there's a print diagnostic in my code on one line, I see > the Gc output, and the print diagnostic on the next line of my code never appears. > > The problem occurs whether I compile to byte-code or native (Linux x64) code. > > At first, I thought the hanging problem was due to network code blocking. But I rewrote > that to be multithreaded -- no difference. I changed some other code to use Buffers > instead of strings, and by generating less garbage, the code went farther. > > Are there known issues with the OCaml gc? I'm using OCaml 3.11 on Fedora 12. > > -- Paul Since ocaml doesn't do concurrent multithreading you can still block the app with one thread blocking. If you have a blocking function you need to enter/leave_blocking_section() around it. The Unix.read/write stubs do that already but if you have your own stubs they might need that too. What does strace say? MfG Goswin