From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by walapai.inria.fr (8.13.6/8.13.6) with ESMTP id pBUNjqEq001218 for ; Sat, 31 Dec 2011 00:45:52 +0100 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: As4BAN1M/k7RVdgvkGdsb2JhbABDqhyCMAgiAQEBAQkJDQcUBCGCCwImgVQBBQEOFDWdXoJbCpxJiyxjBIg3jEuFT4guPYQY X-IronPort-AV: E=Sophos;i="4.71,435,1320620400"; d="scan'208";a="137323933" Received: from mail-qw0-f47.google.com ([209.85.216.47]) by mail1-smtp-roc.national.inria.fr with ESMTP/TLS/RC4-SHA; 31 Dec 2011 00:45:46 +0100 Received: by qadb17 with SMTP id b17so8865179qad.6 for ; Fri, 30 Dec 2011 15:45:45 -0800 (PST) Received: by 10.224.189.136 with SMTP id de8mr445419qab.85.1325288745726; Fri, 30 Dec 2011 15:45:45 -0800 (PST) Received: from [192.168.1.6] (66-189-25-86.dhcp.oxfr.ma.charter.com. [66.189.25.86]) by mx.google.com with ESMTPS id h9sm75405963qac.13.2011.12.30.15.45.44 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 30 Dec 2011 15:45:44 -0800 (PST) From: orbitz@ezabel.com Content-Type: text/plain; charset=us-ascii Date: Fri, 30 Dec 2011 18:45:42 -0500 Message-Id: <96F225D0-B458-4E25-BE34-3976989984B2@ezabel.com> To: Caml List Mime-Version: 1.0 (Apple Message framework v1084) X-Mailer: Apple Mail (2.1084) Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by walapai.inria.fr id pBUNjqEq001218 Subject: [Caml-list] Understanding usage by the runtime I am running a fork of mfp's ocamlmq. I am trying to track down an apparent memory leak, after a week of heavy usage the process is using up 2GB of RAM, and after looking in all the obvious places (all of the containers tracked in the state object in the mq appear to be empty or steady in their size, including queues, data is moving in and out of them but not accumulating, memory consumption should be nearly O(1)) I decided to see what the gc could tell me. I've been printing out gc stats and am wondering if someone can help me grok how the runtime works. In this case I'm trying to compare top to what the gc says. The exact values are below, but the essence of it is that top states the process is using 238m of RAM whereas the gc states that the heap size is about 66megs. My understanding is that the heap size is the total amount of memory that the runtime has under its supervision. I am running Ubuntu Linux on a 64bit virtual machine running in VMWare on an Ubuntu Linux OS. My questions are: - Is top untrustworthy here? Or is the heap_words value not the full story? - Are there any tools that make it easier for me to track down memory leaks? Thank you Top: VIRT = 250m RES = 238m GC: Heap size according to gc output = 66536k minor_words: 6843117723 promoted_words: 271790582 major_words: 1752005911 minor_collections: 210261 major_collections: 2358 heap_words: 8516608 heap_chunks: 16 top_heap_words: 30736896 live_words: 6936631 live_blocks: 1083582 free_words: 1579967 free_blocks: 1457 largest_free: 399643 fragments: 10 compactions: 465