From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@sympa.inria.fr Delivered-To: caml-list@sympa.inria.fr Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by sympa.inria.fr (Postfix) with ESMTPS id 8E6747F1C3 for ; Fri, 23 Nov 2012 03:34:57 +0100 (CET) Received-SPF: None (mail4-smtp-sop.national.inria.fr: no sender authenticity information available from domain of songcq@gmail.com) identity=pra; client-ip=209.85.219.54; receiver=mail4-smtp-sop.national.inria.fr; envelope-from="songcq@gmail.com"; x-sender="songcq@gmail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail4-smtp-sop.national.inria.fr: domain of songcq@gmail.com designates 209.85.219.54 as permitted sender) identity=mailfrom; client-ip=209.85.219.54; receiver=mail4-smtp-sop.national.inria.fr; envelope-from="songcq@gmail.com"; x-sender="songcq@gmail.com"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail4-smtp-sop.national.inria.fr: no sender authenticity information available from domain of postmaster@mail-oa0-f54.google.com) identity=helo; client-ip=209.85.219.54; receiver=mail4-smtp-sop.national.inria.fr; envelope-from="songcq@gmail.com"; x-sender="postmaster@mail-oa0-f54.google.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AvsAAAjgrlDRVds2mGdsb2JhbABEwCIIFg4BAQEBAQgJDQcUJ4IVUAEbHgMSCAEHXQERAQUBiC8BAw+eTIJsjDOCeIRgChknDVmIdQEFDI1FgycDiFyNJY5iFimEHQ X-IronPort-AV: E=Sophos;i="4.83,304,1352070000"; d="scan'208";a="163506593" Received: from mail-oa0-f54.google.com ([209.85.219.54]) by mail4-smtp-sop.national.inria.fr with ESMTP/TLS/RC4-SHA; 23 Nov 2012 03:34:56 +0100 Received: by mail-oa0-f54.google.com with SMTP id n9so14955526oag.27 for ; Thu, 22 Nov 2012 18:34:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=9DXCs1WJET/OVubmA01yMSSrmva/evpDxxipcFjJPXM=; b=zKDRv26iFWZ1DDWMsUiZZaBjBmYqcs+DEe4mErMSOWMthftYbUgybyfx1oXB/XeBXm qvd/SVFykRY7EjMyEku/F6W4h9++vBTQ1hHx9Q21wUGNKt3JP7w1SDg/+aSBY2cJdH56 uwrVKPaUOvHW58c52JMEp5aUA2Ioj3N4Ef6onUZnm69Va9Tu68pzWY1A2Ehl6Rjy5iny JiFM/2Ch1sXm512kWrHraBZgcXLH8efajIW89eK4ZoeQTZmkMY7Vety42GEl+z0CGYpr LcGkqjQE7D16YvtlxTRXL+w+yJxD6tXk1feXXtMYFTHvd0Mn7QSAP2e9/z7fL6EUG7Bo O2HQ== MIME-Version: 1.0 Received: by 10.182.177.72 with SMTP id co8mr1799710obc.53.1353638095647; Thu, 22 Nov 2012 18:34:55 -0800 (PST) Received: by 10.60.141.102 with HTTP; Thu, 22 Nov 2012 18:34:55 -0800 (PST) Date: Fri, 23 Nov 2012 10:34:55 +0800 Message-ID: From: Chengqi Song To: caml-list@inria.fr Content-Type: multipart/alternative; boundary=e89a8f643104d8732604cf206d0f Subject: [Caml-list] Memory usage of ocaml program --e89a8f643104d8732604cf206d0f Content-Type: text/plain; charset=ISO-8859-1 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 --e89a8f643104d8732604cf206d0f Content-Type: text/html; charset=ISO-8859-1 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
--e89a8f643104d8732604cf206d0f--