Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: Goswin von Brederlow <goswin-v-b@web.de>
To: Paul Steckler <Paul.Steckler@nicta.com.au>
Cc: "caml-list@yquem.inria.fr" <caml-list@yquem.inria.fr>
Subject: Re: [Caml-list] GC hangs application
Date: Wed, 11 Aug 2010 14:21:40 +0200	[thread overview]
Message-ID: <87pqxpnxuz.fsf@frosties.localdomain> (raw)
In-Reply-To: <2EB36A07AAE8C44BBB1986425E7A22D0128715A3DE@atp-mbx1.in.nicta.com.au> (Paul Steckler's message of "Wed, 11 Aug 2010 19:30:44 +1000")

Paul Steckler <Paul.Steckler@nicta.com.au> 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


  reply	other threads:[~2010-08-11 12:21 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-11  9:30 Paul Steckler
2010-08-11 12:21 ` Goswin von Brederlow [this message]
2010-08-11 12:53 ` [Caml-list] " Basile Starynkevitch
2010-08-11 14:21 ` Richard Jones

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=87pqxpnxuz.fsf@frosties.localdomain \
    --to=goswin-v-b@web.de \
    --cc=Paul.Steckler@nicta.com.au \
    --cc=caml-list@yquem.inria.fr \
    /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