From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=AWL,SPF_FAIL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by yquem.inria.fr (Postfix) with ESMTP id 5A917BB84 for ; Mon, 12 Jan 2009 12:41:31 +0100 (CET) X-IronPort-AV: E=Sophos;i="4.37,252,1231110000"; d="scan'208";a="19469003" Received: from discorde.inria.fr ([192.93.2.38]) by mail2-smtp-roc.national.inria.fr with ESMTP; 12 Jan 2009 12:41:31 +0100 Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id n0CBfUkY015088 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=OK) for ; Mon, 12 Jan 2009 12:41:30 +0100 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ArADAFe7aklQRFuwgWdsb2JhbACUEwEBFiK9H4Vv X-IronPort-AV: E=Sophos;i="4.37,252,1231110000"; d="scan'208";a="33610395" Received: from furbychan.cocan.org ([80.68.91.176]) by mail4-smtp-sop.national.inria.fr with ESMTP/TLS/AES256-SHA; 12 Jan 2009 12:41:30 +0100 Received: from rich by furbychan.cocan.org with local (Exim 4.63) (envelope-from ) id 1LMLAd-0000W3-Fo; Mon, 12 Jan 2009 11:41:27 +0000 Date: Mon, 12 Jan 2009 11:41:27 +0000 To: John Lepikhin Cc: caml-list@inria.fr Subject: Re: [Caml-list] Re: memory usage Message-ID: <20090112114127.GA1568@annexia.org> References: <1231746106.4376.27.camel@john-laptop> <20090112083913.GA28059@annexia.org> <1231751641.4376.39.camel@john-laptop> <1231759695.4376.55.camel@john-laptop> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1231759695.4376.55.camel@john-laptop> User-Agent: Mutt/1.5.13 (2006-08-11) From: Richard Jones X-Miltered: at discorde with ID 496B2C6A.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; descriptors:01 ocaml:01 descriptors:01 compiler:01 2009:98 quicker:98 threads:01 threads:01 wrote:01 unix:01 unix:01 caml-list:01 short:01 data:02 data:02 On Mon, Jan 12, 2009 at 07:28:15PM +0800, John Lepikhin wrote: > > To get real memory used, (Sys.word_size * live_word / 8). Do you use > > out-of-heap datastructure that can use memory ? (malloc-ed > > datastructure). > > The only specific module is ocaml-fd (send file descriptors over pipes). What version of OCaml is this? I had a look at the source for ocaml-fd and it doesn't seem like it should leak memory. Certainly if there is a memory leak, it would be a subtle one. > I have suspicion on it, but as I said before, 90% of process memory is > filled with specific text data, which is got inside threads and sent to > socket using Unix.write. This data doesn't look like file > descriptors :-) > All other modules are from distribution (Unix, String, Mutex, Threads). It does seem very unlikely that Unix.write would be a problem -- it's a very commonly used function. I'm afraid to say that you'll have to post a short reproducer here before I can look at this further ... > I heard about ocaml-memprof patch. Will it help here? I haven't used it. Seems like you have to patch the compiler. If you suspect a problem in a C binding somewhere, then a quicker approach would probably be to run the program using valgrind. Rich. -- Richard Jones Red Hat