From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by yquem.inria.fr (Postfix) with ESMTP id BA770BC57 for ; Tue, 2 Mar 2010 22:01:28 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApYCALIKjUtKfVM2mGdsb2JhbACPJoN/h1UIFQEBAQEBCAkMBxMisR5ChF4iiFUBAQMFhHYEgxeJAw X-IronPort-AV: E=Sophos;i="4.49,569,1262559600"; d="scan'208";a="45879434" Received: from mail-gw0-f54.google.com ([74.125.83.54]) by mail3-smtp-sop.national.inria.fr with ESMTP; 02 Mar 2010 22:01:28 +0100 Received: by gwaa20 with SMTP id a20so399252gwa.27 for ; Tue, 02 Mar 2010 13:01:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to:cc :content-type; bh=nlsNTZod7iniW+0JdbMqNd//+EKRC0cnlH6A1UZ3z+k=; b=bZCbl87FiwIW9NMQerVEVkGxoP/yEwLhvacmjuBJ4GJ8339DDNYBWXxOKmESqTUHgV OndfZoS7tEVzJ9/LtGPfkb7FbCHausIfSwp2qW1SclpbQ33xncAS66WmEO3ys9jGGGyp 0Z31cw32fl1ASzXxWVZd2qDkOILbj3kGkuFs0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; b=kU0tFyw7tyCi45XhK4zsEhuKRN7ApDSdkgd76uX9DTF84/AsYHorEmZ5WKb5WJNdlc U93ri60XeaB4asCat8c/KZdjck1FdizZ3fQjXISKa6Fgg33QuG7HQohvLjG4QpONS3We 8hdwGiZZHOtkpqlh4rHtT9jcQUMM9jUY3+INI= MIME-Version: 1.0 Sender: peter.hawkins@gmail.com Received: by 10.101.176.10 with SMTP id d10mr762953anp.74.1267563687643; Tue, 02 Mar 2010 13:01:27 -0800 (PST) In-Reply-To: <5043CED0-7CEC-4813-8325-76C3196E8FEE@gmail.com> References: <37150F07-8902-464A-9A0E-44A0C424C87B@gmail.com> <20100301085430.GA16106@annexia.org> <5043CED0-7CEC-4813-8325-76C3196E8FEE@gmail.com> Date: Tue, 2 Mar 2010 13:01:27 -0800 X-Google-Sender-Auth: ef1242648c81e4ea Message-ID: Subject: Re: [Caml-list] gc overhead From: Peter Hawkins To: Warren Harris Cc: OCaml Content-Type: text/plain; charset=ISO-8859-1 X-Spam: no; 0.00; gcc's:01 ocaml:01 ocaml:01 warren:98 28,:98 warren:98 garbage:01 wrote:01 wrote:01 stack:01 caml-list:01 short:01 gprof:03 gprof:03 overhead:04 Hi... On Tue, Mar 2, 2010 at 12:11 PM, Warren Harris wrote: > > On Mar 1, 2010, at 12:54 AM, Richard Jones wrote: > >> On Sun, Feb 28, 2010 at 04:16:03PM -0800, Warren Harris wrote: >>> >>> I would like to determine what percentage of my application's cpu time >>> is spent in the garbage collector (for tuning purposes, but also just >>> to monitor the overhead). Is there any way to obtain this information >>> short of using gprof? Additional information provided by Gc.stat would >>> be ideal, or perhaps a Gc.alarm that was called at the beginning of >>> the gc cycle, but neither of these seem to exist. >> >> I would have to say what's wrong with using gprof? > > What's wrong with it is that it provides no way to monitor gc overhead in an > active service. I would have recommended using oprofile on linux, which I greatly prefer to GCC's built-in profiling support for profiling C programs. It has a low and tunable overhead, and because it's a sampling profiler it doesn't perturb the results anywhere near as much as standard profiling instrumentation. Unfortunately last time I checked it had poor OCaml support (no support for unwinding the OCaml call stack, so no context-sensitivity in the profiles). That said, you probably don't need context-sensitivity to determine the fraction of execution time spent in the GC. It might be worth a try... Peter