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 sympa.inria.fr (Postfix) with ESMTPS id B8E447F1C3 for ; Fri, 23 Nov 2012 16:30:05 +0100 (CET) Received-SPF: None (mail1-smtp-roc.national.inria.fr: no sender authenticity information available from domain of thelema314@gmail.com) identity=pra; client-ip=209.85.223.182; receiver=mail1-smtp-roc.national.inria.fr; envelope-from="thelema314@gmail.com"; x-sender="thelema314@gmail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail1-smtp-roc.national.inria.fr: domain of thelema314@gmail.com designates 209.85.223.182 as permitted sender) identity=mailfrom; client-ip=209.85.223.182; receiver=mail1-smtp-roc.national.inria.fr; envelope-from="thelema314@gmail.com"; x-sender="thelema314@gmail.com"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail1-smtp-roc.national.inria.fr: no sender authenticity information available from domain of postmaster@mail-ie0-f182.google.com) identity=helo; client-ip=209.85.223.182; receiver=mail1-smtp-roc.national.inria.fr; envelope-from="thelema314@gmail.com"; x-sender="postmaster@mail-ie0-f182.google.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AhQCADaWr1DRVd+2kWdsb2JhbABEwC0IFg4BAQEBCQkNBxIpgh4BAQU4CAEbHAIDDAYFCw0JFg8JAwIBAgEPAhEBBQEcEwYCAQGHdgEDD6BVjDOCeIRbChknDVmIdQEFDItCaYEagycDiF6LToFVhWuFR4MwP4Qu X-IronPort-AV: E=Sophos;i="4.83,307,1352070000"; d="scan'208";a="182888327" Received: from mail-ie0-f182.google.com ([209.85.223.182]) by mail1-smtp-roc.national.inria.fr with ESMTP/TLS/RC4-SHA; 23 Nov 2012 16:29:50 +0100 Received: by mail-ie0-f182.google.com with SMTP id s9so12286229iec.27 for ; Fri, 23 Nov 2012 07:29:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; bh=3IonfxFSMF6rPtE4jtBequDdxrpsE8TQ7FOGsLqFUZc=; b=G6Vpd++NzTDmNiPoEqr5N3k14LvcZ3z76KFi7/bffOuzOPprJbvlLvUvE5VdvbgjtG eulDGq1zlwlUJfCiOOwwJK5rfzFSM+kncSwfBLeJK2R715oeD5dyW0IsicBueIPQPQcH DtKJNVSbeMpUq4cz3zsLwhwziNjT5QEMrFsoCfal9gHajIvVzHTeFCFXvRAZEXLBLP1x zr1Zow94jW9pFcn50nZbfgT+SBx5ZRFJujO8WBNTLYIAi2ysASZ0lyCfHVd9HzTbXSGH qec+GBb+KdPhEeFhEMEOd34YgR4QbuNFyhWYdb6kigQatdfRDu6PiDRDZvLR9qSQw8eJ 7AZw== Received: by 10.50.214.68 with SMTP id ny4mr3828425igc.65.1353684589950; Fri, 23 Nov 2012 07:29:49 -0800 (PST) Received: from [192.168.4.18] (99-121-78-10.lightspeed.lnngmi.sbcglobal.net. [99.121.78.10]) by mx.google.com with ESMTPS id bg10sm4454638igc.6.2012.11.23.07.29.48 (version=SSLv3 cipher=OTHER); Fri, 23 Nov 2012 07:29:49 -0800 (PST) Message-ID: <50AF9672.4020800@gmail.com> Date: Fri, 23 Nov 2012 10:29:54 -0500 From: Edgar Friendly User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: caml-list@inria.fr References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Caml-list] Memory usage of ocaml program Also Bigarrays, although this falls under "libraries that use C bindings". E. On 11/23/2012 1:40 AM, Gabriel Scherer wrote: > If you use the C bindings (or a library that does), you may have > allocated memory from C, outside the OCaml heap. This memory is not > handled by the GC and will not appear in the GC stats. > > On Fri, Nov 23, 2012 at 3:34 AM, Chengqi Song wrote: >> I have the same program (same binary) running in different modes. From >> GC stats I see they're using the same amount of heap now (209m) and >> the stack is small. But in top's RES column, I see one is using 270m >> memory and the other one is using 622m. Forcing heap compaction does >> not change the numbers. >> >> I don't quite understand this difference. A program's memory usage >> should be code, static data, heap and stack. For the same binary, code >> and static data segment should be the same, and now that GC stats >> tells me heap and stack are the same, why there is a 352m difference >> in memory usage? >> >> Thanks