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.9 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 mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by yquem.inria.fr (Postfix) with ESMTP id 98B8CBB84 for ; Mon, 12 Jan 2009 11:45:44 +0100 (CET) X-IronPort-AV: E=Sophos;i="4.37,252,1231110000"; d="scan'208";a="21354693" Received: from discorde.inria.fr ([192.93.2.38]) by mail3-smtp-sop.national.inria.fr with ESMTP; 12 Jan 2009 11:45:43 +0100 Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id n0CAjgn3014148 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=OK) for ; Mon, 12 Jan 2009 11:45:43 +0100 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AlcDAMCtaklQW+UCe2dsb2JhbACUEQEBFiIEvRmFbw X-IronPort-AV: E=Sophos;i="4.37,252,1231110000"; d="scan'208";a="19465397" Received: from main.gmane.org (HELO ciao.gmane.org) ([80.91.229.2]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/AES256-SHA; 12 Jan 2009 11:45:42 +0100 Received: from list by ciao.gmane.org with local (Exim 4.43) id 1LMKIf-0001bd-Tx for caml-list@inria.fr; Mon, 12 Jan 2009 10:45:42 +0000 Received: from ks300734.kimsufi.com ([91.121.65.225]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 12 Jan 2009 10:45:41 +0000 Received: from sylvain by ks300734.kimsufi.com with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 12 Jan 2009 10:45:41 +0000 X-Injected-Via-Gmane: http://gmane.org/ To: caml-list@inria.fr From: Sylvain Le Gall Subject: Re: memory usage Date: Mon, 12 Jan 2009 10:45:34 +0000 (UTC) Message-ID: References: <1231746106.4376.27.camel@john-laptop> <20090112083913.GA28059@annexia.org> <1231751641.4376.39.camel@john-laptop> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: ks300734.kimsufi.com User-Agent: slrn/pre0.9.9-102 (Linux) Sender: news X-Miltered: at discorde with ID 496B1F56.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; le-gall:01 eprintf:01 byte:01 chunks:01 garbage:01 wrote:01 sys:03 let:03 let:03 size:95 reachable:05 stat:07 stat:07 john:08 john:08 On 12-01-2009, John Lepikhin wrote: >> Starting point should be to call this periodically: >> >> Gc.compact (); >> let stat = Gc.stat () in >> let live_words = stat.Gc.live_words in >> eprintf "live words %d\n%!" live_words; >> >> which will tell you how many words (ie 4 or 8 byte chunks) are >> reachable according to the garbage collector. > > Richard, here is result (statistics was saved every 10 seconds): > > live words - RSS: > > 186980 - 12380KB <-- after first 10 seconds of work > 154156 - 18232KB > 153923 - 19648KB > ... > after 10 minutes of work: > 203842 - 33436KB > 170559 - 33528KB > 187018 - 33664KB > 71626 - 33592KB > > Sometimes live words drops down to 40.000. But RSS always stay near > 30-50MB. > 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). Regards, Sylvain Le Gall